24.01.2019, 13:09
He wanted to say, you could write it like this:
Anyway, i think your problem is, that you overwrite your CrateObject.
Because if you Create the new object the old isnt destroyed and gets overrided.
So, you can solve this, by an array of CrateObjects or by destroying the old one, before you create a new one
PS:
For constant arrays, use stock const:
PHP Code:
case DIALOG_CRATE:
{
if(IsValidDynamicObject(CrateObject)) DestroyDynamicObject(CrateObject);
DestroyDynamic3DTextLabel(Text3D:dynamiccrate3DText);
CrateObject = 0;
if(!response) return SendClientMessageTA(-1, "{FFA500}» [CRATE] The crate has been destroyed! Another will respawn soon.");
switch(listitem)
{
case 0: GivePlayerWeapon(playerid, 27, 32), SendClientMessage(playerid, COLOR_WHITE,"* You have equiped a {FFA500}Combat Shotgun{FFFFFF}.");
case 1: GivePlayerWeapon(playerid, 29, 32), SendClientMessage(playerid, COLOR_WHITE,"* You have equiped a {FFA500}MP5{FFFFFF}.");
}
}
Because if you Create the new object the old isnt destroyed and gets overrided.
So, you can solve this, by an array of CrateObjects or by destroying the old one, before you create a new one

PS:
For constant arrays, use stock const:
PHP Code:
stock const Float:g_CrateSpawns[][3] =
{
{821.9344,-1868.2295,6.7148}
{1281.3082,-2000.0718,58.2978},
{1800.3622,-2180.2473,13.5547},
{1647.9771,-2102.3044,13.5547}
};


