01.08.2016, 16:59
PHP код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1) {
new PID; //define the playerid we wanna kick
new reason[64]; //the reason, put into a string
new str[128]; //a new message string
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
GetPlayerName(playerid, Adminname, sizeof(Adminname));
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "di[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "{3BB9FF}KASUTA: {FFFFFF}/kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
if(!IsPlayerConnected(PID))
return SendClientMessage(playerid, COLOR_GREY, "Kasutaja ei ole hetkel sees");
format(str, sizeof(str), "'%s' sai kicki administraator '%s'. Pхhjus: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(COLOR_RED, str); //send that message to all
Kick(PID); //kick the playerid we've defined
}
else //if he has not got the permissions
{
SendClientMessage(playerid, COLOR_GREY, "Sul pole хigusi, seda commandi kasutada."); //return this message
}
return 1;
}
"KASUTA: /kick [playerid] [reason]"
And dont kick out my ingame. why?