Loot and object destroying problem
#4

All right. So, let's say you permit single loot item per dying player (just to simplyfy).

Outside of any function, somewhere near top of your file put this - it will declare array (static keyword will make it "visible" only in file you're looking at, not in includes) of MAX_LOOTS size, with initial values in each field equal INVALID_OBJECT_ID.
pawn Код:
#define MAX_LOOTS 30
static
    LootObjects[MAX_LOOTS] = { INVALID_OBJECT_ID, ... };
Somewhere you are creating the object:
pawn Код:
public OnGamemodeIni()
{
//(...)
    LootObjects[0] = CreateObject(356, X, Y, Z, rX, rY, rZ);
//(...)
}
And then when crouching

pawn Код:
DestroyObject(LootObjects[0]);
Add more objects just changing the [0] to next numbers
Reply


Messages In This Thread
Loot and object destroying problem - by Voxel - 24.09.2013, 09:36
Re: Loot and object destroying problem - by Misiur - 24.09.2013, 10:31
Re: Loot and object destroying problem - by Voxel - 24.09.2013, 10:38
Re: Loot and object destroying problem - by Misiur - 24.09.2013, 11:09
Re: Loot and object destroying problem - by Voxel - 24.09.2013, 14:37
Re: Loot and object destroying problem - by Voxel - 24.09.2013, 15:03
Re: Loot and object destroying problem - by Pottus - 24.09.2013, 15:05
Re: Loot and object destroying problem - by Voxel - 24.09.2013, 15:14
Re: Loot and object destroying problem - by Voxel - 24.09.2013, 16:23
Re: Loot and object destroying problem - by Pottus - 24.09.2013, 16:45

Forum Jump:


Users browsing this thread: 2 Guest(s)