23.12.2013, 13:54
every thing work fine but when i kick or ban some one it restart server some time and all player stats gone admin level every thing gone
Код:
CMD:kick(playerid, params[]) { if(Player[playerid][pAdmin] >= 2) { new id,reason[50]; new string[128]; if(sscanf(params, "us[50]", id,reason))return SendClientMessage(playerid, -1, "Usage: /kick [playerid] [Reason]"); if(IsPlayerConnected(id)) { if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_KRED, "Invalid Player"); if(Player[playerid][pAdmin] < Player[id][pAdmin]) return SendClientMessage(playerid, COLOR_KRED," You cant use this on Higher Admin") ; format(string,sizeof(string),"Administrator '%s' has kicked '%s' for [ %s ] ",GetName(playerid),GetName(id),reason); SendClientMessageToAll(COLOR_KRED,string); SetTimerEx("KickPlayer",200,false,"d", id); return GameTextForPlayer(id,"~r~you Are kick By ~r~Admin",3000,1); // Freeze the player } else return SendClientMessage(playerid, COLOR_KRED, "Player is not connected!"); } else return SendClientMessage(playerid, COLOR_KRED, "You need level 2 admin to use this cmd!"); } CMD:ban(playerid, params[]) { if(Player[playerid][pAdmin] >= 3) { new id,reason[50]; new string[128]; if(sscanf(params, "us[50]", id,reason))return SendClientMessage(playerid, -1, "Usage: /ban [playerid] [Reason]"); if(IsPlayerConnected(id)) { if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_KRED, "Invalid Player"); if(Player[playerid][pAdmin] < Player[id][pAdmin]) return SendClientMessage(playerid, COLOR_KRED," You cant use this on Higher Admin") ; format(string,sizeof(string),"Administrator '%s' has Banned '%s' for [ %s ]",GetName(playerid),GetName(id),reason); SendClientMessageToAll(COLOR_KRED,string); SetTimerEx("Banned",200,false,"d", id); return GameTextForPlayer(id,"~r~you Are Banned By ~r~Admin",3000,1); // Freeze the player } else return SendClientMessage(playerid, COLOR_KRED, "Player is not connected!"); } else return SendClientMessage(playerid, COLOR_KRED, "You need level 3 admin to use this cmd!"); } forward KickPlayer(playerid); public KickPlayer(playerid) { if(IsPlayerConnected(playerid)) Kick(playerid); return 1; } forward Banned(playerid); public Banned(playerid) { if(IsPlayerConnected(playerid)) Ban(playerid); return 1; }