22.09.2010, 17:59
So here is the problem, i want , that when i'm in a GM the following commands(Just an example, i can add more later)
/nrg /akill t be prohibited while in a DM.But since i use ZCMD i find it hard to make.
So is there any solution? I tried everything! with strfind strcmp i tried with loops and i tried with return 0 -1, but it gives me the messages that i'm not allowed to use the command BUT the command gets executed.
I've tried everything..
Here is what i have at the moment!
I would appreciate this VERY VERY much...
/nrg /akill t be prohibited while in a DM.But since i use ZCMD i find it hard to make.
So is there any solution? I tried everything! with strfind strcmp i tried with loops and i tried with return 0 -1, but it gives me the messages that i'm not allowed to use the command BUT the command gets executed.
I've tried everything..
Here is what i have at the moment!
pawn Код:
AllowedDMCommands[2][0] =
{
{"/nrg"},{"/akill"}/*/setmyinterior /setmyworld /richlist /killslist /deathslist"
"/mute /muteex /unmute /freeze /unfreeze /freezeex /warn /settime "
"/setworld /setinterior /setweather /disarm /akill/sethealth /healall"
"/setarmour /heal /setdrunk /car /carcolor /setplayergravity"
"/setkills /setdeaths /setscore /givescore /setcash /givecash /setcookies /gethere /fu"
"/taketo /givecar /setgravity /setvip"
"/ban /kick /slapall /fuall"
"/setall(kills|deaths|score|cash|cookies|time|weather|world|interior)"
"/giveall(score|cash|cookies)"
"/setlevel"
"/vpm"*/
};
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(P_DATA[ playerid ][ P_InDM ] == 1)
{
for(new i = 0; i < sizeof(AllowedDMCommands);i++)
{
//if( strfind(cmdtext, AllowedDMCommands[ i ][ 0 ], true) != -1) return -1;
//IgnoreCommand(AllowedDMCommands[ i ][ 0 ])
if( strfind(cmdtext, AllowedDMCommands[ i ][ 0 ], false) != -1)
{
SCMLW(" NO NO ");
}
}
}
return 1;
}