New RP Script : Lags when more than 20 players connected
#5

Quote:

You have to many timers. And AddStaticVehicleEx should not be -1. -1 is either never or all the time?

We are nowadays making tests with only 1 timer who calls all the functions.
And it seems that -1 means never. But if you think that the problem could come from that value, I'll change it.

Quote:

What "heavy" functions are you calling and how often are you calling them?

When a player rides a car, we have a function that calculates his speed each second. And we also check it he isn't near a radar.
We also have a function that checks the player's position to know if the player is on a pickup. (So we use 2 "For" Loops : one for the houses and one for the businesses).
And we also use another timer that checks each 2 seconds the player's position. We use it for one of our faction and for our jobs.

Quote:

Something else about the MAX_PLAYERS_CURRENT:

In fact, MAX_PLAYERS_CURRENT isn't the last connected ID, but the higher ID used by an online player.

Quote:

Also, if you are, don't use OnPlayerUpdate to save files or so.

We just use the OnPlayerUpdate for our 1000 objects scripted in a streamer called ''Double O Objects"
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)