06.08.2017, 01:41
try this
PHP код:
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);
KickEx(pid);
}
}
else
{
SendClientMessage(playerid, rot, "Error: Du bist kein Admin!");
}
return 1;
}
function Kick2(playerid) { Kick(playerid); }
stock KickEx(playerid)
{
SetTimerEx("Kick2", 100, 0, "i", playerid);
}