[0.3a R4] The first pickup created does not apply it's type properly
#1

Hello,

I've been playing with pickups for few hours and then i think i discovered a bug in samp.

BUG: The first pickup created on a map within the OnGameModeInit() callback (no matter if with AddStaticPickup() or CreatePickup() ) does not apply it's type (https://sampwiki.blast.hk/wiki/Pickup_help) properly.

Background: I've tried creating a type 23 or type 1 (which is also mistaken, as type 1 is pickable) in the OnGameModeInit() callback (meaning a pickup will be there forever), but anytime i did the pickup just disappeared (and got destroyed; at least it's ID reference was lost) after picking up and never spawned again. I figured that it happens only to the first pickup in game, next ones are fine and do remember their types.

Possible SAMP cause and fix: Never seen the SAMP sourcecode, but i assume the built-in pickup types callbacks get the enumeration wrong. They think that "0" is no-pickup, instead of first-pickup. The negative response (no-pickup) for that built-in pickup checking algorithms should be -1

Gamemode workaround: Just create a whatever-pickup somewhere at the bottom of the ocean and forget about it.
Example:
Код:
OnGameModeInit() {

  // (...) your code here

  CreatePickup(1253, 0, 649.810241, -2978.665039, -61.069240, -1); // 1253 are just hydra bomb-alike "flashes" so it's unpickable anyway
}
Reply
#2

Are you sure those Co-ordonates are even right? -61.069240 seems a bit low for a Z axis.
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller ]
Are you sure those Co-ordonates are even right? -61.069240 seems a bit low for a Z axis.
Could be for a map under ground.
Reply
#4

Quote:
Originally Posted by [HiC
TheKiller ]
Are you sure those Co-ordonates are even right? -61.069240 seems a bit low for a Z axis.
I told You it's the middle of the ocean - also deep in it
Reply
#5

I can confirm this. When I was making my business system, I was always testing with type 23 on the first pickup and it was pickupable, which it shouldn't be.

When I changed to Incognito's streamer for pickups, the IDs started at 1 and the type worked as expected.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)