20.05.2012, 20:10
I was trying to make /kick [id] [Reason] command with zcmd but i failed,I wish someone will help me...
pawn Код:
COMMAND:kick(playerid,params[] )
{
new name[MAX_PLAYER_NAME];
new giveplayerid;
GetPlayerName(playerid, name, sizeof(name)); // pretty self-explanatory
if (PlayerInfo[playerid][pAdminLevel] >=2 || IsPlayerAdmin(playerid))
{
if(giveplayerid != INVALID_PLAYER_ID) // if the player is online
{
new string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"%s has been kicked by %s, Reason: %s ");
SendClientMessageToAll(0xFFFFFFF,string);
return Kick(playerid); // returns the command to kick the player
}
}
else
SendClientMessage(playerid, COLOR_RED, "[ERROR:] Invalid ID.");
else
SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not an admin!");
return 1;
}