25.01.2015, 09:06
Hello, so the server was lagging a bit, then the lag increases, then the server hbeing frozen, i mean i see all players like paused, when i do /q I see that i am still ingame, and when i try to get inside again, it says Server closed the connection, and after I saw my CPU Usage i found out that it is 10.3%, and in less than a min it increased to 13.7%, why is this happening?
Is this the reason, if yes, then how can I fix it?:
Please help..
Is this the reason, if yes, then how can I fix it?:
pawn Код:
public OnPlayerUpdate(playerid)
{
new hacker[MAX_PLAYER_NAME];
GetPlayerName(playerid, hacker, MAX_PLAYER_NAME);
if(GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 37)
{
if(PlayerInfo[playerid][pAdmin] == 0)
{
new antimsg[128];
format(antimsg, sizeof(antimsg), "%s (%d) Has Been Kicked By Anti-Cheat (AC) | Reason: Weapon Hacks.", hacker, playerid);
SendClientMessageToAll(0x00FFFFFF, antimsg);
SendClientMessage(playerid, 0xFF0000AA, "You Have Been Kicked By Anti-Cheat (AC) | Reason: Weapon Hacks.");
SetTimerEx("TimeKicker", 500, false, "d", playerid);
}
}
new Float:Armour;
GetPlayerArmour(playerid, Armour);
if(Armour > 0.0)
{
if(Info[playerid][VIPLevel] < 3)
{
new antimsg[128];
format(antimsg, sizeof(antimsg), "%s (%d) Has Been Kicked By The Anti-Cheat (AC) | Reason: Armour Hacks.", hacker, playerid);
SendClientMessageToAll(0x00FFFFFF, antimsg);
SendClientMessage(playerid, 0xFF0000AA, "You Have Been Kicked By The Anti-Cheat (AC) | Reason: Armour Hacks.");
SetTimerEx("TimeKicker", 500, false, "d", playerid);
}
}
new str[256];
format(str,sizeof(str),"~r~Kills: ~w~%d ~g~Deaths: ~w~%d",PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths]);
TextDrawSetString(Text:Stats[playerid],str);
if(PlayerInfo[playerid][pKills]<10)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Newbie Shooter");
}
else if(PlayerInfo[playerid][pKills]>=10 && PlayerInfo[playerid][pKills]<75)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Killer Shooter");
}
else if(PlayerInfo[playerid][pKills]>=75 && PlayerInfo[playerid][pKills]<150)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Master Shooter");
}
else if(PlayerInfo[playerid][pKills]>=150 && PlayerInfo[playerid][pKills]<300)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Pro Shooter");
}
else if(PlayerInfo[playerid][pKills]>=300 && PlayerInfo[playerid][pKills]<450)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Striker Shooter");
}
else if(PlayerInfo[playerid][pKills]>=450 && PlayerInfo[playerid][pKills]< 675)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Freekill Shooter");
}
else if(PlayerInfo[playerid][pKills]>=675 && PlayerInfo[playerid][pKills]< 1000)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Psycho Shooter");
}
else if(PlayerInfo[playerid][pKills]>=1000 && PlayerInfo[playerid][pKills]< 1500)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Fatal Shooter");
}
else if(PlayerInfo[playerid][pKills]>=1500 && PlayerInfo[playerid][pKills]< 2250)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Havoc Shooter");
}
else if(PlayerInfo[playerid][pKills]>=2250 && PlayerInfo[playerid][pKills]< 3375)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Extreme Shooter");
}
else if(PlayerInfo[playerid][pKills]>=3375 && PlayerInfo[playerid][pKills]< 5100)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Wild Shooter");
}
else if(PlayerInfo[playerid][pKills]>=5100 && PlayerInfo[playerid][pKills]< 7650)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Hazardous Shooter");
}
else if(PlayerInfo[playerid][pKills]>=7650 && PlayerInfo[playerid][pKills]< 11475)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~IGI Shooter"); /*Scripted By Sufyan*/
}
else if(PlayerInfo[playerid][pKills]>=11475 && PlayerInfo[playerid][pKills]< 17500)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Tactical Shooter");
}
else if(PlayerInfo[playerid][pKills]>=17500 && PlayerInfo[playerid][pKills]< 26250)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Dedicated Shooter");
}
else if(PlayerInfo[playerid][pKills]>=26250 && PlayerInfo[playerid][pKills]< 39375)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Insane Shooter");
}
else if(PlayerInfo[playerid][pKills]>=39375 && PlayerInfo[playerid][pKills]< 60000)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~The Real Shooter");
}
else if(PlayerInfo[playerid][pKills]>=60000 && PlayerInfo[playerid][pKills]< 100000)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Professional Shooter");
}
else if(PlayerInfo[playerid][pKills]> 100000)
{
TextDrawSetString(Text:R_1[playerid],"~r~RANK:~w~Rockstar Shooter");
}
if(GetPlayerAnimationIndex(playerid) != 0)
{
if(Info[playerid][VIPLevel] >= 1)
{
new string[128];
format(string, sizeof(string), "{F3FF02}%s", GetVIPName(playerid));
SetPlayerChatBubble(playerid,string,0xFF0000FF, 100.0, 10000); // creates the string
}
}
new uzone[MAX_ZONE_NAME];
GetPlayer2DZone(playerid, uzone, MAX_ZONE_NAME);
PlayerTextDrawSetString(playerid,Textdraw444[playerid],uzone);
new respectf[128];
format(respectf, sizeof(respectf), "Respect: ~w~%d", Info[playerid][Respect]);
PlayerTextDrawSetString(playerid,Textdraw000[playerid],respectf);
new adf[128];
format(adf, sizeof(adf), "Adrenaline Pills: ~w~%d", LPinfo[playerid][Adre]);
PlayerTextDrawSetString(playerid,Textdraw111[playerid],adf);
new tdf[128];
format(tdf, sizeof(tdf), "Grams Of Drugs: ~w~%d", LPinfo[playerid][Drugs]);
PlayerTextDrawSetString(playerid,Textdraw222[playerid],tdf);
new raf[128];
format(raf, sizeof(raf), "Ratio: ~w~%0.2f", Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths]);
PlayerTextDrawSetString(playerid,Textdraw333[playerid],raf);
return 1;
}