AxelDV Posted June 14, 2017 Share Posted June 14, 2017 Vector3 coords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), 1); Hash obj = GAMEPLAY::GET_HASH_KEY("example"); OBJECT::CREATE_OBJECT(obj, coords.x, coords.y, coords.z, 1, 1, 1); How edit coords of last spawned object Link to comment Share on other sites More sharing options...
alloc8or Posted June 15, 2017 Share Posted June 15, 2017 (edited) // you could make obj a global variable so you can access it anywhere in your codeObject obj = OBJECT::CREATE_OBJECT(modelHash, coords.x, coords.y, coords.z, 1, 1, 1);SET_ENTITY_COORDS_NO_OFFSET(obj, ...); Edited June 15, 2017 by Unknown_Modder Link to comment Share on other sites More sharing options...
AxelDV Posted June 24, 2017 Author Share Posted June 24, 2017 // you could make obj a global variable so you can access it anywhere in your codeObject obj = OBJECT::CREATE_OBJECT(modelHash, coords.x, coords.y, coords.z, 1, 1, 1);SET_ENTITY_COORDS_NO_OFFSET(obj, ...); not functions say not declared if (getOption)==1) { Object obj = OBJECT::CREATE_OBJECT(modelHash, coords.x, coords.y, coords.z, 1, 1, 1); } if (getOption) == 2) { ENTITY::SET_ENTITY_COORDS(obj,1,1,1,1,1); } ??? Link to comment Share on other sites More sharing options...
alloc8or Posted June 24, 2017 Share Posted June 24, 2017 Make obj a global variable. Link to comment Share on other sites More sharing options...
AxelDV Posted June 24, 2017 Author Share Posted June 24, 2017 (edited) Make obj a global variable. Thanks now function but how to get name of the object? Edited June 25, 2017 by AxelDV Link to comment Share on other sites More sharing options...
ins1de Posted June 25, 2017 Share Posted June 25, 2017 (edited) Make obj a global variable. Thanks now function but how to get name of the object? You have two options : Create a script that gives you the object hash of the last object you aimed/shot at, find on Google a huge object list and CTRL+F your hash http://objects.codeshock.hu/gallery.php, use keywords to find your object Don't forget that the CREATE_OBJECT native takes hashes (0xblabla or long int) as model arguments. If you know the real name of your prop, for example, "my_prop_01", you must convert it to the respective hash with GAMEPLAY::GET_HASH_KEY("my_prop_01") and then use it in the create object native. It's also a good thing to work with conditional checks to prevent the loading of invalid objects: if(STREAMING::IS_MODEL_IN_CDIMAGE(yourHash) && STREAMING::IS_MODEL_VALID(yourHash)){//request object model//create object//whatever you want} Edited June 25, 2017 by ins1de Link to comment Share on other sites More sharing options...