[Include] [INC] The fix for the epic pickup bug. [Finally]
#1

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:
pawn Code:
#include <pickupfix>
And then, add
pawn Code:
PICKUP_FIX
On OnPlayerPickupPickup callback like this:
pawn Code:
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!
Reply
#2

Cool
Reply
#3

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.
Reply
#4

very good, could i suggest? make pickups for vehicles
Reply
#5

.. 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.
Reply
#6

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
Reply
#7

nice, looks great - but I never got the pickup bug in my script
Reply
#8

Please can someone give me simple instructions and tell me where the line
Code:
PICKUP_FIX
is meant to go and everything.,
Thanks

TM
Reply
#9

Quote:
Originally Posted by KANiS6111
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:
pawn Code:
#include <pickupfix>
And then, add
pawn Code:
PICKUP_FIX
On OnPlayerPickupPickup callback like this:
pawn Code:
[b]public OnPlayerPickUpPickup(playerid, pickupid)
{
  FIX_PICKUPS[/b]

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!
Reply
#10

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)
Reply
#11

Quote:
Originally Posted by Seif_
Quote:
Originally Posted by error55o
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
Reply
#12

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 .
Reply
#13

Well... you can add functions yourself
Reply
#14

nice KANiS
Reply
#15

Quote:
Originally Posted by KANiS6111
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:
pawn Код:
#include <pickupfix>
And then, add
pawn Код:
PICKUP_FIX
On OnPlayerPickupPickup callback like this:
pawn Код:
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 ??
Reply
#16

Quote:
Originally Posted by Sebihunter
nice, looks great - but I never got the pickup bug in my script
Only happens on Linux
Reply
#17

this include isn't really working for me
Reply
#18

oh sorry, i edited the range of 5.0 to 1.0 and now it works Much better


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
Reply
#19

I'm FREE HOSTER!!! XD
Reply
#20

Quote:
Originally Posted by Dark_BasS
I'm FREE HOSTER!!! XD
wtf... Spam Much?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)