SA-MP Forums Archive
[0.3a R4] The first pickup created does not apply it's type properly - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: [0.3a R4] The first pickup created does not apply it's type properly (/showthread.php?tid=124330)



[0.3a R4] The first pickup created does not apply it's type properly - Kyeno - 30.01.2010

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
}



Re: [0.3a R4] The first pickup created does not apply it's type properly - [HiC]TheKiller - 30.01.2010

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


Re: [0.3a R4] The first pickup created does not apply it's type properly - Finn - 30.01.2010

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.


Re: [0.3a R4] The first pickup created does not apply it's type properly - Kyeno - 30.01.2010

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



Re: [0.3a R4] The first pickup created does not apply it's type properly - ev0lution - 31.01.2010

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.