31.07.2018, 13:43
Server got restarted when I kick someone...
PHP код:
CMD:kick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "{FF0000}Error: {FFFFFF}Wrong command!! {FF0000}Check availables commands from here `{FFFFFF}/cmds{FF0000}`.");
new pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid, string[128];
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "{FF0000}Error: {FFFFFF}You must be ADMIN ON DUTY to kick someone.");
if(sscanf(params, "us[128]", targetid, params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "{FF0000}Error: {FFFFFF}INVAILD PLAYER ID / NAME.");
if(PlayerInfo[playerid][pAdmin] < PlayerInfo[targetid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "{FF0000}Error: {FFFFFF}Player has a higher admin level than you. [CAN'T KICKED]!");
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(targetid,tName,sizeof(tName));
Kick(targetid);
format(string, sizeof(string), "{FB00FF}[KICKED]: PLAYER %s(%d) has been KICKED by Admin %s(%d), REASON: %s.", tName,targetid, pName,playerid, params);
SendClientMessageToAll(-1, string);
return 1;
}