06.08.2017, 21:53
Quote:
Hello,
I tried to create a /kick command with a timer for a delayed kick. Scriptlines: Код:
dcmd_kick(playerid, params[]) { if(IsPlayerAdmin(playerid)) { new pid, reason[128], name[MAX_PLAYER_NAME], done[128]; if(sscanf(params, "uz", pid, reason)) { SendClientMessage(playerid, rot, "ERROR: /kick [ID/Name] [Grund]"); } if(pid == INVALID_PLAYER_ID) { SendClientMessage(playerid, rot, "ERROR: Spieler ist nicht online."); } else if(pid == playerid) { SendClientMessage(playerid, rot, "Du kannst dich nicht selbst kicken."); } else { GetPlayerName(pid, name, sizeof(name)); format(done, sizeof(done), "%s wurde gekickt. Grund: %s", name, reason); SendClientMessage(playerid, rot, done); SetTimer("KickTimer", 500, false); } } else { SendClientMessage(playerid, rot, "Error: Du bist kein Admin!"); } return 1; } public KickTimer(pid) { Kick(pid); } Example: Код:
forward(yoo); public KickTimer(yoo) { Kick(yoo); } |