Working Around Pickup Bug - 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: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Working Around Pickup Bug (
/showthread.php?tid=179276)
Working Around Pickup Bug -
Simon - 26.09.2010
Quite a major feature has been added to a script I'm helping to work on, however SA:MP's
pickup bug is breaking it.
I'm wondering if anybody has found a proven way to work around the bug and if so, how did you work around it so that you can depend on the pickup id's?
Re: Working Around Pickup Bug -
Mauzen - 26.09.2010
The easiest method i could imagine (but maybe not the most efficient) would be to store all positions of the pickups, and then, in OnPlayerPickUpPickup compare the players postion with the position of all pickups (maybe with max 1m distance to get an accurate result)
The maximum pickups are 2048, so if you need them all it would take
2048 x 4 x 4 byte = 32768 bytes = 32kb
(3 floats + 1 int (maybe you can make it a bool) to determine if it is a valid, created pickup)
The size should make no big difference if you already got a medium-big script.
Re: Working Around Pickup Bug -
Simon - 26.09.2010
That sounds like it may be what I have to do. I guess the positive is that I'd have an array of pickup info, which I've always sort of wanted