I need Help plz when i ban some player or kick or warn 3 time then some time its restart server badly and all players stats Removed How to Fix that plz Help thanks in advance
The banned/kicked players' stats removed ? Are you saving it under OnPlayerDisconnect ?
yeah all thing saving well but when i kick or ban or warn 3 time then it restart server and all gone
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;
}
something in the code is making ur server crash. find out what it is,