RemoveBuilding avoiding crashes
#1

Alright so I've got a question. Since I have like 700 RemoveBuildingForPlayer each time I reset the server all players that stay online will crash since it will double those RemoveBuildingForPlayer (proven correct) now is there any way to avoid this?
Reply
#2

Maybe kick them when you reset the server? Not sure but I'm also pretty sure that GMXing doesn't call an array of functions, so your variables probably don't reset properly, that being said it's best to kick them all together to avoid this.
Reply
#3

This can be prevented with SVars.
Reply
#4

1. Tell your players to use this mod: SA-MP-RemoveBuilding-Crashfix;
2. Try to reduce the number of RemoveBuilding calls by playing around with modelid parameter (-1) and/or increase range where applicable;
3. Kick players before restart so they must reconnect (unless they use 3rd party mods)
Reply
#5

Quote:
Originally Posted by RaZVaN ^ xD
View Post
1. Tell your players to use this mod: SA-MP-RemoveBuilding-Crashfix;
2. Try to reduce the number of RemoveBuilding calls by playing around with modelid parameter (-1) and/or increase range where applicable;
3. Kick players before restart so they must reconnect (unless they use 3rd party mods)
All are unnecessary.

SVars
Reply
#6

The thing is you can remove multiple buildings with one RemoveBuilding line, you could optimize your removes to be less while functioning the same, while players technically have those building removed while the client is up and running (don't quote me on that tho, I recall reading it somewhere written by one of Beta Testers) so you can put a check to see if current player has gone thru the function before, if not do it.
Also afaik PVars stay while GMXing too, there is no point using SVars.
Reply
#7

Quote:
Originally Posted by PrO.GameR
View Post
The thing is you can remove multiple buildings with one RemoveBuilding line, you could optimize your removes to be less while functioning the same, while players technically have those building removed while the client is up and running (don't quote me on that tho, I recall reading it somewhere written by one of Beta Testers) so you can put a check to see if current player has gone thru the function before, if not do it.
Also afaik PVars stay while GMXing too, there is no point using SVars.
Yeah, with the range parameter. But I guess it will be the same result, you're still removing those objects so the struggle may nit be worth it.

PVars won't work for this situation. PVars have a playerid parameter, IDs won't always be the same after they reconnect. Hence, SVars!

Also:

PVars are automatically deleted when a player leaves the server (after OnPlayerDisconnect), meaning you don't have to manually reset variables for the next player who joins.

So yeah, no.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)