I need help creating objects on death with custom objectids.
#1

Ok, I have coded way too much to copy and paste here but if you don't mind could you take a look at this.

This code will not do anything, it's just an example.
Код:
define MAX_LOOT 5000
new loot[MAX_LOOT];

ongamemodeinit
loot[0] = createdynamicobject(id, pos, etc.);
loot[1]...
loot[2]...
etc.

onplayerkeystatechange
if player presses crouch
if player in range of loot[0]
{destroyobject loot[0]
giveplayermoney(playerid, 200);
}

OnPlayerDeath
{
getplayerpos
createobjectid that hasn't been used yet
resetplayer(playerid);
}
If you can't tell by that "example", what I've done is I've defined a few pickups for players that give them money, guns, etc...

what I want to do is drop those objects when they die, allowing other players to pick them up.

But this must be done dynamically because if it just creates the object, samp won't know if the new player is in range of that point.

But I don't know how to do this yet, I've never done anything dynamic within my coding before. I mostly help other coders and this is my first solo coding experience.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)