04.08.2011, 11:21
pawn Код:
if(strcmp("/kick", cmd, true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]");
}
new id = strval(tmp);
if(IsPlayerConnected(id))
{
if(strlen(gMessage) == 0)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: No Reason Specified",pName,playerid,iName,id);
SendClientMessageToAll(INFO,Message);
Kick(id);
{
else if(strlen(gMessage) > 0) //Line 160
}
gMessage = strrest(cmdtext,idx);
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage);
SendClientMessageToAll(INFO,Message);
Kick(id);
return 1;
{
else
{
SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!");
return 1;
}
}
else
{
SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID");
}
}
return 1;
}