CMD:kick(playerid,params[])
{
if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,COLOR_RED,"You are not authorized to use that command.");//Checking if the player has admin level 3, if not it sends him a message.
new id;//Creating a variable to store the selected id;
if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /kick <id>");//Checking if the player has selected an id, other wise it sends him a message. We used the "u" specifier, because he can put a name or an id.
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"That player is not connected!");//Checking if the selected user is connected or not.
Kick(id);
SendClientMessageToAll(COLOR_LIGHTRED,"AdmCmd: %s has kicked %s, reason: %s", adminname, offender, params[2]);
return 1;
}
Team Deathmatch\gamemodes\LTEST.pwn(895) : warning 202: number of arguments does not match definition Team Deathmatch\gamemodes\LTEST.pwn(895) : warning 202: number of arguments does not match definition Team Deathmatch\gamemodes\LTEST.pwn(895) : warning 202: number of arguments does not match definition |
SendClientMessageToAll(COLOR_LIGHTRED,"AdmCmd: %s has kicked %s, reason: %s", adminname, offender, params[2]);
You have to create a string, and to format it, by puting your text in it.
Then, call SendClientMessageToAll. |
new Text[128];
format(Text,128,"AdmCmd: %s has kicked %s, reason: %s", adminname, offender, params[2]);
SendClientMessageToAll(COLOR_LIGHTRED,Text);
pawn Код:
|