06.08.2017, 02:31
Well in theory
You're setting the timer to kick the target (pid) So that's why. If you replaced pid with playerid, it will kick the player using the command not the person he/she is trying to kick
You're setting the timer to kick the target (pid) So that's why. If you replaced pid with playerid, it will kick the player using the command not the person he/she is trying to kick
PHP код:
dcmd_kick(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, rot, "Error: Du bist kein Admin!");
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]");
if(pid == INVALID_PLAYER_ID) return SendClientMessage(playerid, rot, "ERROR: Spieler ist nicht online.");
if(pid == playerid) return SendClientMessage(playerid, rot, "Du kannst dich nicht selbst kicken.");
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(pid);
public KickTimer(pid)
{
Kick(pid);
return true;
}