MrGTAmodsgerman 230 Posted August 4, 2015 (edited) Hello, So is it possible to spawn a model that i add to a RPF Archive? And if its possible, how i can do it? Edited August 4, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
thewhitehammer99 564 Posted August 4, 2015 Hello, So is it possible to spawn a model that i add to a RPF Archive? And if its possible, how i can do it? I'm not 100% sure, but I doubt that would work. Quote Share this post Link to post Share on other sites
leftas 128 Posted August 4, 2015 Hello, So is it possible to spawn a model that i add to a RPF Archive? And if its possible, how i can do it? I'm not 100% sure, but I doubt that would work.It should work, it worked in GTA IV. And to work just generate hash, you can do that by one native in game play namespace or build Jenkins one at time hasher. All the best, Paul. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 4, 2015 (edited) Hello, So is it possible to spawn a model that i add to a RPF Archive? And if its possible, how i can do it? I'm not 100% sure, but I doubt that would work.It should work, it worked in GTA IV. And to work just generate hash, you can do that by one native in game play namespace or build Jenkins one at time hasher. All the best, Paul. Can you give me an example? please @leftas! Edited August 4, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 5, 2015 Can anybody explain me this? I dont get it Quote Share this post Link to post Share on other sites
leftas 128 Posted August 5, 2015 (edited) I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Edited August 5, 2015 by leftas Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 5, 2015 I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Quote Share this post Link to post Share on other sites
InfamousSabre 224 Posted August 6, 2015 (edited) I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Open natives.h > CTRL+F > Type "hash" > ENTER Hash GET_HASH_KEY(char *value) // D24D37CC275948CC 98EFF6F1 Edited August 6, 2015 by InfamousSabre Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 6, 2015 I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Open natives.h > CTRL+F > Type "hash" > ENTER Hash GET_HASH_KEY(char *value) // D24D37CC275948CC 98EFF6F1 and then? I want to assign a new hash to a new model, i dont want to get a Hash! Quote Share this post Link to post Share on other sites
CamxxCore 163 Posted August 6, 2015 I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Open natives.h > CTRL+F > Type "hash" > ENTERHash GET_HASH_KEY(char *value) // D24D37CC275948CC 98EFF6F1 and then? I want to assign a new hash to a new model, i dont want to get a Hash!You don't need to "assign" a hash. A hash is a hash. The hash of your model is going to be relative to whatever you name it. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 6, 2015 I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Open natives.h > CTRL+F > Type "hash" > ENTERHash GET_HASH_KEY(char *value) // D24D37CC275948CC 98EFF6F1 and then? I want to assign a new hash to a new model, i dont want to get a Hash!You don't need to "assign" a hash. A hash is a hash. The hash of your model is going to be relative to whatever you name it. like that? int hash = Function.Call<int>(Hash.GET_HASH_KEY, "custom_model");Model mod = new Model(hash);Prop test = World.CreateProp(mod, new Vector3(0f, 0f, 0f), true, true); because it didnt work Quote Share this post Link to post Share on other sites
leftas 128 Posted August 6, 2015 Provide more info ? Check if that model can be requested, does it see as existant in Image ? and so on. If you use code you provided, you need to be in center of all map, if you want to see your object, also that object should be valid. All the best, Paul. Quote Share this post Link to post Share on other sites
InfamousSabre 224 Posted August 6, 2015 (edited) I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Open natives.h > CTRL+F > Type "hash" > ENTERHash GET_HASH_KEY(char *value) // D24D37CC275948CC 98EFF6F1 and then? I want to assign a new hash to a new model, i dont want to get a Hash!You don't need to "assign" a hash. A hash is a hash. The hash of your model is going to be relative to whatever you name it. like that?int hash = Function.Call<int>(Hash.GET_HASH_KEY, "custom_model");Model mod = new Model(hash);Prop test = World.CreateProp(mod, new Vector3(0f, 0f, 0f), true, true);because it didnt work Well, no. The function does not return an int, it returns a hash. typedef DWORD Hash; Edited August 7, 2015 by InfamousSabre Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 6, 2015 (edited) I will two days later. But I gave you all info, you could do this by your own. All the best, Paul. Ok, because i dont know what jetkins is or what native function you mean. I didnt find something like generate hash or generate by model name. Open natives.h > CTRL+F > Type "hash" > ENTERHash GET_HASH_KEY(char *value) // D24D37CC275948CC 98EFF6F1 and then? I want to assign a new hash to a new model, i dont want to get a Hash!You don't need to "assign" a hash. A hash is a hash. The hash of your model is going to be relative to whatever you name it. like that?int hash = Function.Call<int>(Hash.GET_HASH_KEY, "custom_model");Model mod = new Model(hash);Prop test = World.CreateProp(mod, new Vector3(0f, 0f, 0f), true, true);because it didnt workWell, no. The function does not return an int, it returns a hash. So like that? var model = new Model("custom_model"); model.Request(250); // Check the model is valid if (model.IsInCdImage && model.IsValid) { // Ensure the model is loaded before we try to create it in the world while (!model.IsLoaded) Script.Wait(0); // if the code come to this then your model is loaded // Create the prop in the world World.CreateProp(model,spawnort, true, true); } // Mark the model as no longer needed to remove it from memory. model.MarkAsNoLongerNeeded(); Ped Spieler = Game.Player.Character; GTA.Math.Vector3 spawnort = Spieler.Position + (Spieler.ForwardVector * 5); @leftas @InfamousSabre it dont work Edited August 6, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 7, 2015 typedef DWORD Hash; @InfamousSabre How to use that? And what exactly does it? gives a definition for type of a Hash and the type is DWORD? Quote Share this post Link to post Share on other sites
InfamousSabre 224 Posted August 7, 2015 typedef DWORD Hash;@InfamousSabreHow to use that? And what exactly does it? gives a definition for type of a Hash and the type is DWORD? yup. Thats exactly what it does. It's already part of types.h, so you dont need to type it or anything. I was just showing that Hash type is not an int, but a DWORD. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 7, 2015 (edited) typedef DWORD Hash;@InfamousSabreHow to use that? And what exactly does it? gives a definition for type of a Hash and the type is DWORD? yup. Thats exactly what it does. It's already part of types.h, so you dont need to type it or anything. I was just showing that Hash type is not an int, but a DWORD. Ped Spieler = Game.Player.Character;GTA.Math.Vector3 spawnort = Spieler.Position + (Spieler.ForwardVector * 5);typedef DWORD hash = Function.Call<DWORD>(Hash.GET_HASH_KEY, "custom_model");Model mod = new Model(hash);World.CreateProp(test, spawnort, true, true) @InfamousSabre oh ok now, so what i need to do now to spawn the custom_model.ydr? and a another question: Where i can find these types.h and native.h files? Edited August 7, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
leftas 128 Posted August 7, 2015 Well, *duh...*. DWORD doesn't exist in c#, only unsigned int, use this. Also you still return int *Double duh...*... And you still spawning it in center of world... They're in c++ scripthook's sdk. All the best, Paul. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 7, 2015 (edited) Well, *duh...*. DWORD doesn't exist in c#, only unsigned int, use this. Also you still return int *Double duh...*... And you still spawning it in center of world... They're in c++ scripthook's sdk. All the best, Paul. @leftas The Code i post was only a copy paste code, it shows how i understand the hash with DWORD. Now i edit it, and i code in .NET and calm down Edited August 7, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
leftas 128 Posted August 7, 2015 Hm ? I just said that this won't work. I'm not angry or anything. And read more on what typedef does. I'm sure that it only exists in C++/C. All the best, Paul. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 7, 2015 (edited) Hm ? I just said that this won't work. I'm not angry or anything. And read more on what typedef does. I'm sure that it only exists in C++/C. All the best, Paul. so is there any other way to spawn the custom_model in C#|.NET? Edited August 7, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
leftas 128 Posted August 7, 2015 No. Hashes are being used for performance. So you just do this Ped Spieler = Game.Player.Character; GTA.Math.Vector3 spawnort = Spieler.Position + (Spieler.ForwardVector * 5); uint hash = Function.Call<uint>(Hash.GET_HASH_KEY, "custom_model"); Model mod = new Model((int)hash); World.CreateProp(mod, spawnort, true, true); All the best, Paul. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 7, 2015 No. Hashes are being used for performance. So you just do this Ped Spieler = Game.Player.Character; GTA.Math.Vector3 spawnort = Spieler.Position + (Spieler.ForwardVector * 5); uint hash = Function.Call<uint>(Hash.GET_HASH_KEY, "custom_model"); Model mod = new Model((int)hash); World.CreateProp(mod, spawnort, true, true); All the best, Paul. Thanks paul, but the model dont want to spawn did i have to add the model and texture file in a special RPF Archive? Or did i need to add the ytd file to the code or something? i really need this, this code question is a small part of my mod i am working on. I need this to fix a texture missing problem (i hope it helps in that way) but i need this for other mods in the future Quote Share this post Link to post Share on other sites
InfamousSabre 224 Posted August 8, 2015 Ah, I assumed C++. My mistake on that part. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 8, 2015 Ah, I assumed C++. My mistake on that part. Not a problem, so you try to help Quote Share this post Link to post Share on other sites
leftas 128 Posted August 8, 2015 No. Hashes are being used for performance. So you just do this Ped Spieler = Game.Player.Character; GTA.Math.Vector3 spawnort = Spieler.Position + (Spieler.ForwardVector * 5); uint hash = Function.Call<uint>(Hash.GET_HASH_KEY, "custom_model"); Model mod = new Model((int)hash); World.CreateProp(mod, spawnort, true, true); All the best, Paul. Thanks paul, but the model dont want to spawn did i have to add the model and texture file in a special RPF Archive? Or did i need to add the ytd file to the code or something? i really need this, this code question is a small part of my mod i am working on. I need this to fix a texture missing problem (i hope it helps in that way) but i need this for other mods in the future Then do checks on model, does GTA V see it as existent or can be loaded ? How to do that ? There are numerous functions for model in Model class. You can try to move them to update.rpf All the best, Paul. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 8, 2015 (edited) No. Hashes are being used for performance. So you just do this Ped Spieler = Game.Player.Character; GTA.Math.Vector3 spawnort = Spieler.Position + (Spieler.ForwardVector * 5); uint hash = Function.Call<uint>(Hash.GET_HASH_KEY, "custom_model"); Model mod = new Model((int)hash); World.CreateProp(mod, spawnort, true, true); All the best, Paul. Thanks paul, but the model dont want to spawn did i have to add the model and texture file in a special RPF Archive? Or did i need to add the ytd file to the code or something? i really need this, this code question is a small part of my mod i am working on. I need this to fix a texture missing problem (i hope it helps in that way) but i need this for other mods in the future Then do checks on model, does GTA V see it as existent or can be loaded ? How to do that ? There are numerous functions for model in Model class. You can try to move them to update.rpf All the best, Paul. I do checks on Model, but GTA V didnt know what the model exist, thats why i need this otherwise i can spawn it if GTA 5 knows it. So normaly in GTA wee need to add a new model generally in a object.dat or something like that but in GTA 5 i cant find something like in GTA 4 add in the update.rpf didnt change anything Edited August 8, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites
leftas 128 Posted August 10, 2015 So what bools methods in model class return also can model be requested or not ? All the best, Paul. Quote Share this post Link to post Share on other sites
Neutrinobeam 15 Posted August 10, 2015 There are natives named IS_MODEL_VALID and IS_MODEL_IN_CD_IMAGE (or similar.) There's likely a file in the RPFs that lists all the models installed along with the actual model resources. Quote Share this post Link to post Share on other sites
MrGTAmodsgerman 230 Posted August 14, 2015 (edited) There are natives named IS_MODEL_VALID and IS_MODEL_IN_CD_IMAGE (or similar.) There's likely a file in the RPFs that lists all the models installed along with the actual model resources. Do you know the name of the file? Edited August 14, 2015 by MrGTAmodsgerman Quote Share this post Link to post Share on other sites