24.04.2015, 01:10
Quote:
I thought 'GetPlayerIP' is not important to share.
Код:
forward DelayKick(playerid); public DelayKick(playerid) { Kick(playerid); return 1; } Код:
CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new giveplayerid; new reason[100]; if(!sscanf(params, "us[70]", giveplayerid,reason)) { if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_GREY,"ERROR: That player is not connected"); if(PlayerInfo[giveplayerid[pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < put high admin level here) return SendClientMessage(playerid, COLOR_GREY, "ERROR: Only Administrators Rank 4 and up can kick other Administrators."); new tname[MAX_PLAYER_NAME]; GetPlayerName(Target,tname,sizeof(tname)); new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); new AllString[256]; format(AllString,sizeof(AllString),"AdmCmd: %s has been kicked by %s.",tname, GetName(playerid)); SendClientMessageToAll(COLOR_LIGHTRED,AllString); format(AllString,sizeof(AllString),"Reason: %s", Reason); SendClientMessageToAll(COLOR_LIGHTRED,AllString); SetTimerEx("DelayKick", 1000, false, "d", giveplayerid); } else SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid/name] [reason]"); } else SendClientMessage(playerid, COLOR_GREY, "ERROR: You don't have the privilege to use this command!"); return 1; } |