SA-MP Forums Archive
RemoveBuilding avoiding crashes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: RemoveBuilding avoiding crashes (/showthread.php?tid=622726)



RemoveBuilding avoiding crashes - TwinkiDaBoss - 25.11.2016

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?


Re: RemoveBuilding avoiding crashes - Dignity - 25.11.2016

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.


Re: RemoveBuilding avoiding crashes - SickAttack - 26.11.2016

This can be prevented with SVars.


Re: RemoveBuilding avoiding crashes - RaZVaN ^ xD - 01.12.2016

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)


Re: RemoveBuilding avoiding crashes - SickAttack - 02.12.2016

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


Re: RemoveBuilding avoiding crashes - PrO.GameR - 03.12.2016

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.


Re: RemoveBuilding avoiding crashes - SickAttack - 03.12.2016

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.