19.01.2019, 12:04
How could i get player kicked for certain amount of time, and also display msg to all and when the player tries to join, he/she will get message example "You are kicked for 4minutes"
PHP Code:
CMD:kick(playerid, params[], help)
{
if(Info[playerid][Level] >= 2)
{
new id, reason[50],string[128];
if(sscanf(params, "uS()[50]", id, reason)) return SCM(playerid, red, "Kick player: /kick <PlayerID> <Reason>");
if(id == INVALID_PLAYER_ID) return SCM(playerid, red, "Invalid player id");
if(Info[playerid][Level] <= Info[id][Level]) return ShowMessage(playerid, red, 6);
if(!isnull(reason))
format(string,sizeof(string),"%s %s has kicked %s: %s",GetLevel(playerid),GetName(playerid),GetName(id),reason);
else format(string,sizeof(string),"%s %s has kicked %s",GetLevel(playerid),GetName(playerid),GetName(id));
SendClientMessageToAll(red,string);
return DelayKick(id);
}
else return ShowMessage(playerid, red, 1);
}