Object not destroying
#1

I've tryed CreatePlayerObject + DestroyPlayerObject and that didn't work
Even with Dyamaic object is this object not destroying, can you help me out?

PHP код:
PlacedBom[playerid] = CreateObject(1252bomX-0.5,bomY,bomZ-0.65,0,-1,-1); 
PHP код:
DestroyObject(PlacedBom[playerid]); 
Reply
#2

DestroyObject() works fine. If it didn't people would know about it. I tested this on a local server with your exact code and the object does get destroyed.
You most likely have object ID mixups in your code. "PlacedBom" gets overwritten with a new ID and references a wrong object.
Reply
#3

Alright, I've created now
Quote:

new PlacedBom[MAX_PLAYERS][2];

but.. it still not destroying

Quote:

PlacedBom[playerid][0] = CreateObject(1252, bomX-0.5,bomY,bomZ-0.65,0,-1,-1);[works]
PlacedBom[playerid][0] = SetTimerEx("vaultdoorboem", 10000, 0, "i", playerid);[works]
DestroyObject(PlacedBom[playerid][0]);[don't work]

Reply
#4

The value of that variable changed when you a assigned it a timer is.
Each elements have unique ids starting from 0.
Earlier, that variable used to have the Id of the object (eg:- 5), and when you assigned the Id of a timer(eg:-10) to that variable, DestroyObject will destroy the object with Id 10 instead of Id 5.

Change this:
PHP код:
PlacedBom[playerid][0] = SetTimerEx("vaultdoorboem"100000"i"playerid);[ 
To this:
PHP код:
PlacedBom[playerid][1] = SetTimerEx("vaultdoorboem"100000"i"playerid); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)