#1

Well the problem and the following when I start my vps serves the normal ping is 130 ~ 150 more after 20hrs on straight starts serves mill entaum I wanted you quoting what causes that can mill good server I use foreach loop instead believe naum that will mill my gm is well optimized just have some system that I'm more undecided which can cause lag and my anti-flood in which case I use it with "SetTimerEx" I have a few objects and 149 vehicles spread across san andreas use also a system of vehicles also get a little hesitant with him naum know if it causes lag the most weird and good if you want me to put one of these systems here ..

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetTimerEx("atuaalizar", 1000, true, "i", playerid);
    return 1;
}
pawn Код:
public OnPlayerUpdate(playerid)
{
    new string[128];
    if(GetPlayerWeapon(playerid) == 17) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Granada de Gбs)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 18) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Molotov Cocktail)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 35 && !BlockCheat[playerid])return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Lanзador de Mнsseis)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 36) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Lanзador de Mнsseis Automбtico)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 37) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Lanзador de Chamas)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 38 && !BlockCheat[playerid]) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Minigun)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 39) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Carga Explosiva)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 40) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Detonador)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 44) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Visгo Noturna)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    if(GetPlayerWeapon(playerid) == 45) return format(string,128,"{F9FAF5}[Anti-Cheat]: {F7AF05}%s[ID:%d] foi kickado por usar arma proibida! {F9FAF5}(Visгo Tйrmica)", pName(playerid),playerid), SendClientMessageToAll(0xFF0000AA,string), Kick(playerid);
    return true;
}
this causes lag?
Reply
#2

Well, i dont think it lags. The Timer setted will update every second and OnPlayerUpdate 1 - 5ms if i'm not wrong. You can also put a timer for that anti-cheat like 1000ms.
Reply
#3

How can I avoid many loops?
Reply
#4

Quote:
Originally Posted by |_MeGaTroN_|
Посмотреть сообщение
How can I avoid many loops?
That's not a loop. That's a timer which update the callback accorded the time assigned by you. If you want to declare a loop you have to use "for", "while".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)