14.07.2012, 14:03
Just fixing up your command so it works out normally.
pawn Код:
COMMAND:kick(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
new id;
new str[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You may not use this command");
if(sscanf(params,"us",id,str)) return SendClientMessage(playerid,-1,"{000000}You may not use this command");
else if(id == playerid)
{
return SendClientMessage(playerid,COLOR_RED,"You can kick yourself");
}
else if(IsPlayerAdmin(id))
{
return SendClientMessage(playerid, COLOR_RED, "You can't kick another admin");
}
else if(id == INVALID_PLAYER_ID)
{
return SendClientMessage(playerid,COLOR_RED, "That player isn't connected");
}
else
{
new KickMessage[128];
new vName[MAX_PLAYER_NAME];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(id,vName,sizeof(pName));
format(KickMessage,sizeof(KickMessage),"Admin: %s(%d) has kicked %s(%d) Reason %s",pName,playerid,vName,id);
Kick(id);
}
return 1;
}