Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. DLC
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
      7. The Diamond Casino Heist
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
MrGTAmodsgerman

Can i spawn a custom Model? (add)

Recommended Posts

MrGTAmodsgerman

Hello,

So is it possible to spawn a model that i add to a RPF Archive?

wb78ys.png

And if its possible, how i can do it?

Edited by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
thewhitehammer99

Hello,

So is it possible to spawn a model that i add to a RPF Archive?

wb78ys.png

And if its possible, how i can do it?

I'm not 100% sure, but I doubt that would work.

Share this post


Link to post
Share on other sites
leftas

 

Hello,

So is it possible to spawn a model that i add to a RPF Archive?

wb78ys.png

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

 

 

Hello,

So is it possible to spawn a model that i add to a RPF Archive?

wb78ys.png

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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

Can anybody explain me this?

I dont get it

Share this post


Link to post
Share on other sites
leftas

I will two days later. But I gave you all info, you could do this by your own.

 

All the best,

Paul.

Edited by leftas

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

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.

Share this post


Link to post
Share on other sites
InfamousSabre

 

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 by InfamousSabre

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

 

 

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!

Share this post


Link to post
Share on other sites
CamxxCore

 

 

 

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!

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

 

 

 

 

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!

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

Share this post


Link to post
Share on other sites
leftas

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.

Share this post


Link to post
Share on other sites
InfamousSabre

 

 

 

 

 

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!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 by InfamousSabre

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

 

 

 

 

 

 

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!
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.

 

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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
MrGTAmodsgerman
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?

 

Share this post


Link to post
Share on other sites
InfamousSabre

 

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?

 

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

 

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?

 

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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
leftas

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
leftas

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
leftas

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

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 :panic: 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

Share this post


Link to post
Share on other sites
InfamousSabre

Ah, I assumed C++. My mistake on that part.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

Ah, I assumed C++. My mistake on that part.

Not a problem, so you try to help

Share this post


Link to post
Share on other sites
leftas

 

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 :panic: 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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

 

 

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 :panic: 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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites
leftas

So what bools methods in model class return also can model be requested or not ?

 

All the best,

Paul.

Share this post


Link to post
Share on other sites
Neutrinobeam

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.

Share this post


Link to post
Share on other sites
MrGTAmodsgerman

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 by MrGTAmodsgerman

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.