Restrict gm below 60

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
Hello, is that possible to restrict gm below level 60 to spawn only limited mobs.

For example a gm can spawn only 5 mob number (adjustable) the quantity. If the gm spawn 6 mobs, a disbottom msg appear, you cannot spawn more that (mob number).

My stupid gm like spawn (unlimited) mobs for player. So I need to make it limited. Haha. Besides that, that will make the gm tired to spawn many times. Lol.

@spawn poring 30

With new script

@spawn poring 5 ( gm need to write 6 times to spawn 30 poring )

#crazy gm that help too much spawn mobs for player. That a bad idea because make player easy hunting a mobs or doing questing. I had warning him, but seem it ignore me. LoL.

 
I dont know if that works, but maybe you can disable it via groups.conf for GMs below 60 and use that script:

- script mobspawn_restriction -1,{ OnInit: bindatcmd("monster", strnpcinfo(3) + "::OnAtcommand"); .maxMobsPerSpawn = 5; end; OnAtcommand: if(getgmlevel() >= 60 || getgmlevel() == 0) end; .@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]); if(.@mobCount > .maxMobsPerSpawn) { dispbottom("You can't spawn more than " + .@mobCount + " mobs at a time."); end; } atcommand("@monster " + .@atcmd_parameters$[0] + " " + .@mobCount); end;}
I don't know if this doesn't fail when the @monster command is restricted but how it should work is, it blocks the original monster command, hooks it and starts the atcommand via script and restricts the monster spawn. If a user with a gm level below 1 or above 60 uses @monster, the script just ends itself instead of doing anything since users below gm level 1 shouldn't be able to use it and users above 60 aren't restricted so the original should work.

If that approach fails or you don't mind having a second monster command you also could use this:

- script mobspawn_restriction -1,{ OnInit: bindatcmd("monster2", strnpcinfo(3) + "::OnAtcommand"); .maxMobsPerSpawn = 5; end; OnAtcommand: if(getgmlevel() == 0) end; .@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]); if(.@mobCount > .maxMobsPerSpawn) { dispbottom("You can't spawn more than " + .@mobCount + " mobs at a time."); end; } atcommand("@monster " + .@atcmd_parameters$[0] + " " + .@mobCount); end;}
Can be used like @monster you just have to use @monster2 it ignores everything below gm level 1. If used by any gm it works like a restricted @monster. All you have to do is to restrict the original @monster command for gms below 60 in the groups.conf.

 
Last edited by a moderator:
@@mleo1 I cant simplify remove him, he has done helped me alot. I just dont like his attitute like spawn monster for player. He said "I just like helped player".
default_sleep.png


@@Winterfox thanks ! I prefer your script no 1. Lets me test first after disable it th groups. Will lets you know this Monday.

 
@@mrlongshen Well, i just don't know if the bindatcmd works on disabled @commands, in case it doesn't, i provided the other script, that implements it as a own command. I am looking forward to hear how it is working out.

 
Code:
-	script	mobspawn_restriction	-1,{	OnInit:		bindatcmd("monster", strnpcinfo(3) + "::OnMonster", 1);		bindatcmd("monstersmall", strnpcinfo(3) + "::OnMonsterSmall", 1);		bindatcmd("monsterbig", strnpcinfo(3) + "::OnMonsterBig", 1);		.maxMobsPerSpawn = 5;	end;	OnMonster:		.@cmdType$ = "monster";	OnMonsterSmall:		if(.@cmdType$ == "")			.@cmdType$ = "monstersmall";	OnMonsterBig:		if(.@cmdType$ == "")			.@cmdType$ = "monsterbig";				if(getgmlevel() >= 60) end; 		.@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]);				if(.@mobCount > .maxMobsPerSpawn) {			dispbottom("You can't spawn more than " +  .@mobCount +  " mobs at a time.");			end;		}				atcommand("@" + .@cmdType$ + " " + .@atcmd_parameters$[0] + " " + .@mobCount);	end;}
 
Last edited by a moderator:
Back
Top