PDA

View Full Version : [Include] [INC] The fix for the epic pickup bug. [Finally]


kazimieras
09/08/2008, 08:41 PM
Hey, I dunno about you, but I was really p*ssed off with the pickup bug SA:MP has. With it, pickup id's were not the same for all players, and that sucks. Today, I have thought of a script to work it around and I'm willing to share. This is an include, but since it's really small, I'll just post the code on pastebin and won't upload the file. So, let's go.

First, make a new include named pickupfix.inc in your includes folder.
Secondly, paste the code from the link in it: http://pastebin.com/f37dd849f
Then add this on top of your script: #include <pickupfix>
And then, add PICKUP_FIX On OnPlayerPickupPickup callback like this:

public OnPlayerPickUpPickup(playerid, pickupid)
{
FIX_PICKUPS

Now that you have done it, there will be no more pickupid messups! Isn't that great?

I made this myself, but I use some Andre's functions, so I gave him credits. Thank you for reading, and goodbye!

Grove
09/08/2008, 09:09 PM
Cool

kazimieras
09/08/2008, 09:17 PM
Pickup positions are written down into an array, and then player position is used to judge wether the player has picked up the pickup of his pickupid or not. If not, the system automaticly finds a pickup closest to the player and assigns it to be the "pickupid". Sry for bad english, but I hope you understood. :)

pspleo
09/08/2008, 09:22 PM
very good, could i suggest? make pickups for vehicles :D

tomozj
09/08/2008, 09:33 PM
.. That's not what this script deals with. This script fixes a bug in which pickup ids were not always correct, nothing to do with vehicles. You can make pickups for vehicles, just look up the different pickup types.

mikster1
28/08/2008, 08:41 AM
PICKUP_FIX

where would i add that?

i have used this but it doesnt seem to fix my problem of two different pickups showing the same menu when they are meant to show different :S


TM

sebihunter
28/08/2008, 04:56 PM
nice, looks great - but I never got the pickup bug in my script

mikster1
29/08/2008, 08:43 AM
Please can someone give me simple instructions and tell me where the line PICKUP_FIX is meant to go and everything.,
Thanks

TM

Neoncore
02/09/2008, 12:44 AM
Hey, I dunno about you, but I was really p*ssed off with the pickup bug SA:MP has. With it, pickup id's were not the same for all players, and that sucks. Today, I have thought of a script to work it around and I'm willing to share. This is an include, but since it's really small, I'll just post the code on pastebin and won't upload the file. So, let's go.

First, make a new include named pickupfix.inc in your includes folder.
Secondly, paste the code from the link in it: http://pastebin.com/f37dd849f
Then add this on top of your script: #include <pickupfix>
And then, add PICKUP_FIX On OnPlayerPickupPickup callback like this:

public OnPlayerPickUpPickup(playerid, pickupid)
{
FIX_PICKUPS

Now that you have done it, there will be no more pickupid messups! Isn't that great?

I made this myself, but I use some Andre's functions, so I gave him credits. Thank you for reading, and goodbye!

error55o
22/10/2008, 09:34 PM
so this wont fix the 14 bug not being called coz your in a car or truck and so on? (14 is the vehicle pickup number)

error55o
24/10/2008, 12:25 AM
so this wont fix the 14 bug not being called coz your in a car or truck and so on? (14 is the vehicle pickup number)

You can just create the timer and run a loop to check if the player is in a vehicle and near the pickup.

lol I'm a scripting n00b, I have tried a few times, unsuccessfully :(

BeckzyBoi
25/10/2008, 07:30 PM
It doesn't stop pickup ids being different for different players... I have always used this method to get around it for OnPlayerPickUpPickup but it doesn't stop DestroyPickup destroying different pickups for different players!

You might want to change the title of the topic because I looked at it genuinely thinking that it was a fix, when it is actually just a piece of code that prevents something the bug can cause http://forum.sa-mp.com/Themes/default/images/post/thumbdown.gif .

kazimieras
03/11/2008, 11:54 AM
Well... you can add functions yourself :|

Reamis
03/11/2008, 12:43 PM
nice KANiS ;)

Tornado
03/11/2008, 02:22 PM
Hey, I dunno about you, but I was really p*ssed off with the pickup bug SA:MP has. With it, pickup id's were not the same for all players, and that sucks. Today, I have thought of a script to work it around and I'm willing to share. This is an include, but since it's really small, I'll just post the code on pastebin and won't upload the file. So, let's go.

First, make a new include named pickupfix.inc in your includes folder.
Secondly, paste the code from the link in it: http://pastebin.com/f37dd849f
Then add this on top of your script: #include <pickupfix>
And then, add PICKUP_FIX On OnPlayerPickupPickup callback like this:

public OnPlayerPickUpPickup(playerid, pickupid)
{
FIX_PICKUPS

Now that you have done it, there will be no more pickupid messups! Isn't that great?

I made this myself, but I use some Andre's functions, so I gave him credits. Thank you for reading, and goodbye!



Why do you say to add PICKUP_FIX onto the OnPlayerPickUpPickup, and then in example we see FIX_PICKUPS ??

x-cutter
31/12/2008, 02:03 AM
nice, looks great - but I never got the pickup bug in my script


Only happens on Linux

ғαιιοцт
22/01/2009, 06:37 PM
this include isn't really working for me :roll:

ғαιιοцт
24/01/2009, 02:31 PM
oh sorry, i edited the range of 5.0 to 1.0 and now it works Much better :D


tip: please don't search for a pickup in a range of 5.0 from the player,
but search for the Closest pickup in a range of 5.0 from the player.

this is why it didn't work.. when my moneypickup was 5.0 away from the other pickup, he gives the other pickup while i took the money pickup

please update this to a next version :o

Dark_BasS
24/01/2009, 03:52 PM
I'm FREE HOSTER!!! :o XD

TrueCoppa
24/01/2009, 04:00 PM
I'm FREE HOSTER!!! :o XD


wtf... Spam Much?

Zamaroht
24/01/2009, 04:18 PM
I think he forgot to say that you have to replace every CreatePickup with CreatePickupA

ғαιιοцт
24/01/2009, 04:55 PM
I think he forgot to say that you have to replace every CreatePickup with CreatePickupA

oh yes that's true
that's why it didn't work for me the 1st time
but than i looked at the inc and i saw i had the change them into CreatePickupA :lol: