24.10.2011, 20:22
My kick command is a bit "weird"
when I do /kick [1] [Test] it kicks me NOT the person who needs to be kicked? umm whats wrong?
pawn Код:
CMD:kick(playerid,params[])
{
if (MasterAccount[playerid][mSuperAdmin] || Character[playerid][cAdminLevel] >= 1)
{
new id,n[MAX_PLAYER_NAME],reason[35], on[MAX_PLAYER_NAME], string[128], string2[128];
if(sscanf(params,"uz",id, reason)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"[SYNTAX]: /kick [PlayerID/PartOfName] [Reason]");
else if(playerid == INVALID_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"[ERROR]: Player not found");
else
{
GetPlayerName(playerid,n,sizeof(n));
GetPlayerName(id,on,sizeof(on));
format(string,sizeof(string),"You have been kicked by Admin: %s for %s",n,reason);
SendClientMessage(playerid,COLOR_GOLD,string);
format(string2, sizeof(string), "[INFO]: Admin Action: %s has kicked %s because: %s",n,on,reason);
SendClientMessageToAll(COLOR_GOLD,string2);
Kick(id);
}
}
else return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You are not a Admin");
return 1;
}