SA-MP Forums Archive
Variable returns false id - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Variable returns false id (/showthread.php?tid=597191)



Variable returns false id - SmoW - 27.12.2015

Whenever I check a variable which I created: ( new Objects[1000] ) and create an object using it ( Objects[0] = CreateObject.... ) if I printf("ObjectID: %d",Objects[0]) it returns ObjectID: 13. Why?


Re: Variable returns false id - Tamy - 27.12.2015

CreateObject returns object ID assigned by the server to that object, so 13 is the object ID of that object.


Re: Variable returns false id - SmoW - 27.12.2015

Quote:
Originally Posted by Tamy
Посмотреть сообщение
CreateObject returns object ID assigned by the server to that object, so 13 is the object ID of that object.
It's not as I didn't create any other objects with that variable before.

Edit: If I do Objects[1] = CreateObject(... , Objects[2] = CreateObject(...it returns me 1 and 2.