30.01.2010, 02:20
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:
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 }