PHP код:
CMD:kick(playerid,params[])
{
new targetid,Reason[50],AdminName[MAX_PLAYER_NAME],TargetName[MAX_PLAYER_NAME],kickmsg[145];
if(PlayerInfo[pAdmin][playerid] >= 1)
{
if(sscanf(params,"us[50]",targetid,Reason))return SendClientMessage(playerid,0xE90A0AFF,"[CMD] /kick [playerid] [reason]");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid,0xE90A0AFF,"[ERROR] Invalid player ID.");
GetPlayerName(playerid,AdminName,MAX_PLAYER_NAME);
GetPlayerName(targetid,TargetName,MAX_PLAYER_NAME);
format(kickmsg,sizeof kickmsg,"[ADMIN] Admin %s has kicked %s [Reason: %s]",AdminName,TargetName,Reason);
SendClientMessageToAll(0xE90A0AFF,kickmsg);
SetTimerEx("KickPlayer",500,0,"i",targetid);
return 1;
}
SendClientMessage(playerid,0xE90A0AFF,"[ERROR] You are not authorized.");
return 1;
}
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
Kick(playerid);
return 1;
}
You have to start the timer with targetid and the repeat as 0.