02.08.2017, 20:28
Kickedid variable isn't necessary and also you created a global variable instead of a player variable. You can simply do that below and also just noticed that you are using a global timer, why are you seriously using a global timer?
So all you need to do is to add this under the kick cmd.
And add this anywhere.
No need to make a variable and even if you made a variable, atleast make a per player variable not global variable and you shouldn't really make a global timer, like seriously.
PHP код:
dcmd_kick(playerid, params[])
{
new pid, reason[128], name[MAX_PLAYER_NAME], done[128];
if(sscanf(params, "uz", pid, reason)) return SendClientMessage(playerid, rot, "ERROR: /kick [ID/Name] [Grund]");
GetPlayerName(pid, name, sizeof(name));
format(done, sizeof(done), "%s wurde gekickt. Grund: %s", name, reason);
SendClientMessage(playerid, rot, done);
SetTimerEx("KickTimer", 500, false, "i", pid);
return 1;
}
forward KickTimer(playerid);
public KickTimer(playerid)
{
Kick(playerid);
}
PHP код:
SetTimerEx("KickTimer", 500, false, "i", pid);
PHP код:
forward KickTimer(playerid);
public KickTimer(playerid)
{
Kick(playerid);
}