Hello,
I am having a problem with destroying an object with DestroyDynamicObject from the Incognito steamer plugin.
I am creating a "vault door" for a dynamic Casino system and I want to make a system where exploding a bomb there removes the door. This system worked fine until something happened and now the object just stays there. Didn't change anything I think?
Here is the code for loading the object
PHP код:
cStats[i][vault] = CreateDynamicObject(2634, 2144.2, 1627, 994.29999, 0, 0, 180,cStats[i][ID],1);
The variable "i" is then the ID of the Casino and cStats[i][ID] is the Virtual World or database ID.
When a player enters a casino a variable pInCasino[playerid] will be set to the casino ID.
This is the command I use to test the destroying of the vault.
PHP код:
YCMD:vault(playerid, params[], help)
{
if(pInCasino[playerid] != -1)
{
new casino = pInCasino[playerid];
if(IsValidDynamicObject(cStats[casino][vault]))
{
DestroyDynamicObject(cStats[casino][vault]);
SendClientMessage(playerid,COLOR_YELLOW,"Object destroyed.");
}
else return SendClientMessage(playerid,COLOR_YELLOW,"Not valid object");
}
else return SendClientMessage(playerid,COLOR_YELLOW,"Not in casino");
return 1;
}
The first time I use this, I get the "Object destroyed" message, second time I get "Not valid object" but the object is still there. Tried leaving the casino and coming back, still nothing changed.
Any advice?
Thanks a lot!