26.11.2011, 06:49
Hello,
I've made a /kick command, but it doesn't work propely for me..
There it is:
What's wrong with that command?
Thanks advance.
I've made a /kick command, but it doesn't work propely for me..
There it is:
PHP Code:
CMD:kick(playerid, params[])
{
new string[256], giveplayerid, adminname[10], reason[50];
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized for that command!");
if(sscanf(params, "us[10]s[50]", giveplayerid, adminname, reason))
return SendClientMessage(playerid, COLOR_GREY, "[SYNTAX]: /kick [ID/PartOfName] [10.chars.max] [50.chars.max]");
if(!IsPlayerConnected(giveplayerid) || giveplayerid == INVALID_PLAYER_ID)
return SendClientMessage(playerid, COLOR_GREY, "Invalid playerid!");
format(string, sizeof(string), "SERVER: %s have been kicked by %s, reason: %s.", Name(giveplayerid), adminname, reason);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(giveplayerid);
return 1;
}
Thanks advance.

