27.04.2013, 02:05
How can i change SERVER:Unkown command. I did search ****** but all or OnPlayerCommandText and I don't have return 0; in my code. Here is mine:
Just one example from the script.
Just one example from the script.
pawn Код:
YCMD:kick(playerid, params[], help)
{
#pragma unused help
if(P_Data[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not an administrator!");
new
string[128],pplayerid, reason[48];
if(sscanf(params, "us[48]", pplayerid, reason)) return SCM(playerid, COLOR_RED, "Usage: /kick [Player ID/Player Name] [Reason]");
if(pplayerid == IPI) return SCM(playerid, COLOR_RED, "Wrong playerid!");
if(P_Data[pplayerid][pAdmin] == 5) return SCM(playerid, COLOR_RED, "You can't ban admin level 5!");
format(string,sizeof(string),""COL_RED"Admin "COL_WHITE"%s "COL_RED"is kick player "COL_WHITE"%s "COL_RED"Reason: %s",GetName(playerid),GetName(pplayerid),reason);
SCMToAll(-1,string);
Kick(pplayerid);
return 1;
}