Quote:
Originally Posted by Yaa
PHP Code:
CMD:event(playerid, params[])
{
if( pInfo[playerid][pAdmin] < 5 )
return 0;
new id;
if (isnull(params))
return SendUsageError( playerid, "/event [create/rename/teles/kick/freeze/disarm/weapons/end]" );
if(!strcmp(params, "kick", true))
{
new kid;
if (sscanf(params, "su", "kick", kid))
return SendUsageError( playerid, "/event [kick] [ID]" );
if(inEvent[kid] == 1)
{
format(str, sizeof(str), "[EVENT] {FFFFFF}%s has been kicked from the event", Name[kid], kid);
SendClientMessageToAll(COLOR_EVENT, str);
SetPlayerHealth(kid, 0);
inEvent[kid] = 0;
eInfo[eventFrozen] = 0;
TogglePlayerControllable(kid, 1);
}
else
{
Error(playerid, "This player is not participating in your event");
}
}
return 1;
}
|
I actually tried that before, it works and sends the usage errors but it does not execute the code if you fill in all parameters.
Anything else?