22.10.2014, 15:11
Ok so i have a kick command, and i have a KickWithMessage stock
Kick command:
Stock:
But i don't seem to be able to get it to work, i wanted it to say to the player: Admin Blk has kicked you reason: test
Kick command:
Код:
CMD:kick(playerid, params[])
{
if (pInfo[playerid][Adminlevel] < 2) return 0;
new targetid, reason[64], string[128], pID;
if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, -1, "/kick <ID> <Reason>");
if(pID == IPI) return SCM(playerid, red, "Player is not connected!");
format(string, sizeof(string), "%s %s has kicked %s reason: %s ", AdminLevelName(playerid), GetName(playerid), GetName(targetid), reason);
SendClientMessageToAll(-1, string);
Kick(targetid);
return 1;
}
Код:
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }
stock KickWithMessage(playerid, message[])
{
SCM(playerid, 0xFF4444FF, message);
SetTimerEx("KickPublic", 100, 0, "d", playerid); //Delay of 1 second before kicking the player so he recieves the message
}

