If this can be a reason for server slowdown - lagg ?
#1

If this can be a reason for server slowdown - lagg ?

pawn Код:
OnPlayerUpdate(playerid)
{
    for(new veh = 0; veh < MAX_VEHICLES; veh++)
    {
        if (CarLocked[veh] == 1) { SetVehicleParamsForPlayer(veh,playerid,0,1); }
        else { SetVehicleParamsForPlayer(veh,playerid,0,0); }
    }
}
??
Reply
#2

omg YES :O

use this

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(CarLocked[vehicleid] == 1) SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
    else SetVehicleParamsForPlayer(vehicleid,forplayerid,0,0);
    return 1;
}
Reply
#3

Quote:
Originally Posted by ikey07
Посмотреть сообщение
If this can be a reason for server slowdown - lagg ?

pawn Код:
OnPlayerUpdate(playerid)
{
    for(new veh = 0; veh < MAX_VEHICLES; veh++)
    {
        if (CarLocked[veh] == 1) { SetVehicleParamsForPlayer(veh,playerid,0,1); }
        else { SetVehicleParamsForPlayer(veh,playerid,0,0); }
    }
}
??
100 % sure, it looks like you want the server to crash!?

MAX_VEHICLES = 2000
OnPlayerUpdate gets called every... like 0.05 seconds.
That means that script part is called about 40.000 times every 1 second for 1 player.
That means if you have 200 players in your server, times 40.000 = 8.000.000 times a second.

So if you have 200 players, that script part will be executed 8 million times per second.
Reply
#4

Well, I have feel about it

Thx, you guys saved me a lot of keyboards and time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)