Quote:
Originally Posted by iPLEOMAX
That wouldn't work because you need to store the OBJECT ID (in your server, not it's model) to a variable.
Which means, when you use CreateObject, make sure you store the returned ID to something.
You know, like: "myobject = CreateObject(...);"
So, if you want to remove it, you need to use DestroyObject(myobject);
|
Damn ... I have a column with ObjectID in the db also. Maybe i can use that. It's AUTO_INCREMENT, and primary key.
Maybe i can use that ?
EDIT:
Quote:
Originally Posted by DarkSlyder
Then you should have a global array like this
pawn Код:
#define MY_OBJECTS 50 // The max. number of objects you could have in the temp map new tempMapObjects[MY_OBJECTS];
and read objects like:
pawn Код:
new tempMapData[e_ObjectData], i; while(i < MY_OBJECTS && mysql_fetch_row_format(query,"|")) { sscanf(query, "p<|>e<dffffffs[128]fd>", tempMapData); tempMapObjects[i++] = CreateObject(tempMapData[model], tempMapData[Xpos], tempMapData[Ypos], tempMapData[Zpos], tempMapData[RX], tempMapData[RY], tempMapData[RZ], tempMapData[DrawDist]); }
Then you can delete them by:
pawn Код:
for(new i; i < MY_OBJECTS; i++) { DestroyObject(tempMapObjects[i]); tempMapObjects[i] = 0; }
|
Hmm im gonna try that