26.11.2011, 17:30
what is wrong with this command?
it is compiling however it doesnt show who has been kicked and the reason..and it is kicking on lan if i press /kick 1 it will kick me eventhough i am id 0 ..help
pawn Код:
CMD:kick(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return GameTextForPlayer(playerid, "~r~ERROR~w~:Only admins can use this command!",5000,3);
else
{
new pname[MAX_PLAYER_NAME],
giveplayerid,
string[128],
reason[50];
if(sscanf(params,"rs[50]",reason)) return GameTextForPlayer(playerid, "~r~ERROR~w~:/kick (playerid) (reason)",5000,3);
else if(!IsPlayerConnected(giveplayerid)||giveplayerid == INVALID_PLAYER_ID) return GameTextForPlayer(playerid, "~r~ERROR~w~:This Player Isn't Connected",5000,3);
else
{
format(string,sizeof(string),"ADMIN KICK: %s has been kicked from the server(Reason:%s)",pname,reason);
SendClientMessageToAll(COLOR_PINK, string);
Kick(giveplayerid);
}
}
return 1;
}