24.09.2013, 11:09
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.
Somewhere you are creating the object:
And then when crouching
Add more objects just changing the [0] to next numbers
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, ... };
pawn Код:
public OnGamemodeIni()
{
//(...)
LootObjects[0] = CreateObject(356, X, Y, Z, rX, rY, rZ);
//(...)
}
pawn Код:
DestroyObject(LootObjects[0]);