[BUG] Pickup id mix-up problem
#1

[ame]http://www.youtube.com/watch?v=153U2MdBgLk[/ame]

On our server we have a rare issue where the pickup id's of certain objects get mixed up. Me and LaZ managed to replicate it today and show it to be a SA-MP related bug, so I thought I'd post a video.

Does anyone have a resolution for this? I've been told to use Incognito's Streamer Plugin, but I'm not a massive fan of resorting to outside means if not necessary.

The pickup in this video is type 19, and triggers code to give the player their armour, and update our anticheat. The numbers on the pickups are their id number, for debugging purposes.

After both collecting the armor, id 144, I reset our armor and kill LaZ. His dropped weapons are id's 291, 292 and 293, but as you'll see, when I pick up the pistol, the server reports that I picked up id 144 instead, leaving the 3dText for 291 still there. When I spawn and come back, 291 is sitting there waiting to be picked up still.
Reply
#2

Do you use DestroyPickup after the player picks it up? If not, try that and change the pickup type to 1 instead of 19.
Reply
#3

Yes the weapon drops are destroyed, but that wouldn't resolve the armour bug either way.
Reply
#4

It looks like the pickups aren't destroyed properly. It seems that slot 144 is emptied after pick up of the armor, so when the game creates the pistol, it puts the pistol info in that slot. But for some reason the armor effects are still in id 144.

Does this only happen in this particular order? If not, in what orders does it also happen? I'm suspicious about pickup type 19 actually, but I have no idea if it's the cause.

Also, could you show us a sample of your script under OnPlayerPickUpPickup which is related to this? That might help finding the cause of the bug. It might be SA-MP related, or a scripting bug.
Reply
#5

The armour is an information icon, and is not destroyed by the script when picked up, it just disappears from view as information icons should (type 19). If you stream out and stream in, it will be there again.
Reply
#6

Well, the wiki states it's an information icon. I've just checked main.scm (Singleplayer script) and there all the information pickups use type 3. Main.scm destroys the information icon manually via script. Although, I don't know if SA-MP uses the same type IDs as singleplayer.

In fact, in main.scm only type 3 and 15 are used. Type 3 for save icons and (weapon) pickups which are later removed by scripts. Type 15 for static respawning weapon pickups. The other IDs might be leftovers from GTA III and Vice City.

Still, I'm not sure if SA-MP uses the same type IDs. I'm going to investigate this, because I'm quite interested. Since there are similarities, but also differences between the SA-MP and Singleplayer type list.
Reply
#7

If you find anything out, please let me know.
Reply
#8

This is my note pad at the moment. I'm not finished yet, but I don't know if I've got the time to do that in the next days.

Quote:

Pickup Type effects

Main (This applies to all types, unless noted otherwise):

AddStaticPickup:
- Spawns only when used in OnGameModeInit / OnFilterScriptInit. (?)
- Gives effects of object model to the player. (A pistol gives pistol ammo, body armor gives body armor);
- Does trigger OnPlayerPickUpPickup with ID, but AddStaticPickup doesn't return the ID itself.

CreatePickup:
- Does trigger OnPlayerPickUpPickup with ID when picked up.
- Can be created everywhere in the script.



ID 0:
- Unpickupable;
- Does not trigger OnPlayerPickUpPickup;
- Always visible (even after server shutdown and restart), will only disappear after client shutdown;
- Does nothing.



ID 1 + 5 + 6 + 7 + 16 + 17 + 21 + 23 + 24:
- Always visible;
- Triggers OnPlayerPickUpPickup every 4 or 5 seconds when standing in pickup;



ID 2 + 15:
- Gives effects of object model to the player. (A pistol gives pistol ammo, body armor gives body armor);
- Respawns after 30 secondes, if the player is further away than 15 meters;
- Triggers OnPlayerPickUpPickup.



ID 3 + 22:
- Gives effects of object model to the player. (A pistol gives pistol ammo, body armor gives body armor);
- Respawns after death;
- Triggers OnPlayerPickUpPickup.



ID 4:
- Gives effects of object model to the player. (A pistol gives pistol ammo, body armor gives body armor);
- Disappears after 15 to 20 seconds.
- Respawns after death.



ID 13:
- Invisible,
- Triggers checkpoint sound when picked up with vehicle;
- Does not trigger OnPlayerPickUpPickup when in vehicle.



ID 14:
- Invisible,
- Triggers checkpoint sound when picked up with vehicle;
- Triggers OnPlayerPickUpPickup when in vehicle.


ID 18:
- Always visible;
- Triggers OnPlayerPickUpPickup every 4 or 5 seconds when standing in pickup;
- Does not give effects of object model. (A pistol model won't give pistol ammo)
- Pressing Tab (Action key) makes it disappear.



ID 19:
- Makes the same sound as when you pick up cash in singleplayer;
- Doesn't respawn.
- Triggers OnPlayerPickUpPickup.



ID 20:
- Always visible;
- Triggers OnPlayerPickUpPickup every 4 or 5 seconds;
- Does not give effects of object model. (A pistol model won't give pistol ammo)
- Disappears when you take a picture of it with a Camera, this triggers a "Snapshot # out of 0" message. (Depending on how many already photographed)
- Taking a picture of it does not trigger OnPlayerPickUpPickup.

It would be nice if someone with a Wiki account could update the Wiki.
Reply
#9

Help, how to fix it?
Video: [ame]http://www.youtube.com/watch?v=aiCFfQFwAlI[/ame]
EDIT: Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)