12.08.2013, 12:27
.......
So, instead of writing if(sscanf(params, "us[128]", id, reason)) { return xxxxx; }
no, you're writing if(sscanf(params, "us[128]", id, reason);
Indeed.
pawn Код:
CMD:kick(playerid,params[])
{
new id,reason[128],name[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][Adminlevel] > 5) { //this is also taken from the tut by Kush
if(sscanf(params,"us[128]",id,reason)) {
return sendClientMessage(playerid, -1, "Usage: /kick <playerid>");
} else {
format(string1,sizeof(string1),"%s have been kicked from the server: reason: %s",GetPlayerName(id,name,sizeof(name)),reason); //this will format the kick message that is being sent to all player connected
SendClientMessageToAll(0xFFFFFF,string1);
Kick(id);//kicks the player
}
} else {
//your error message about that the player is not a admin
}
}
no, you're writing if(sscanf(params, "us[128]", id, reason);
Indeed.