Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Forum Support

    3. Suggestions

[SA]Change NPC model


igotnothing
 Share

Recommended Posts

igotnothing

how do i change NPC model and pedtype with cleo?

Link to comment
Share on other sites

ArmanCan
9 hours ago, igotnothing said:

how do i change

All peds, weapons, vehicles and some objects are already described in Sanny Builder and if i remember correctly it is impossible to change or add a new one..

 

#ARMY - 287 // Model Name - Model ID
#AK47 - 355 // Model Name - Model ID
#KART - 571 // Model Name - Model ID
#BOMB - 364 // Model Name - Model ID

 

All you can do is change the peds by correctly rigging via 3DMax or Zmodeler, export it to a "txd" and "dff" file and tweak the initiated ped files in "Data" and "Models" folders 😉

  • Like 1
Link to comment
Share on other sites

Maybe something like that. Find a char. Get his model. If model is the one you want to change - then delete char and create another one at exactly the same coordinate.
 

:FIND_CHAR
0AE1: [email protected] = random_char_near_point [email protected] [email protected] [email protected] in_radius 25.0 find_next 1 pass_deads 1
0665: get_actor [email protected] model_to [email protected]
:CHECK_MODEL
wait 0
8039:   not [email protected] == 28  //28 is the model you want to replace
jf @FIND_CHAR

00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected]
0172: [email protected] = actor [email protected] Z_angle
009B: destroy_actor [email protected]
009A: [email protected] = create_actor_pedtype 17 model %put_desired_moel_here% at [email protected] [email protected] -100.0
0173: set_actor [email protected] Z_angle_to [email protected]

 

Edited by vladvo
Link to comment
Share on other sites

On 3/7/2023 at 11:56 PM, igotnothing said:

how do i change NPC model and pedtype with cleo?

:changePedModel
//  [email protected] - actorHandle;   [email protected] - newModelID
0226: [email protected] = actor [email protected] health  
if [email protected] == 100
then
    //  if (CStreaming::ms_aInfoForModel[newModelID].m_nLoadState == LOADSTATE_LOADED) {
    if 0248:   model [email protected] available       
    then    
        //  DWORD savedAnimGroup = ped->m_dwAnimGroup;
        0A96: [email protected] = actor [email protected] struct 
        0A8E: [email protected] = [email protected] + 0x4D4   //  m_dwAnimGroup from CPed   
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
    
        //  ped->DeleteRwObject();  
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 
        0A8E: [email protected] = [email protected] + 0x20    //  DeleteRwObject  from CEntityVtbl    
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
        0AA6: call_method [email protected] struct [email protected] num_params 0 pop 0  
        
        //  ped->m_nModelIndex = -1; 
        0A8E: [email protected] = [email protected] + 0x22    //  m_nModelIndex from CEntity
        0A8C: write_memory [email protected] size 2 value -1 virtual_protect 0 
        
        //  ped->SetModelIndex(newModelID);
        0A8E: [email protected] = [email protected] + 0x14    //  SetModelIndex   from CEntityVtbl
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0  
        0AA6: call_method [email protected] struct [email protected] num_params 1 pop 0 [email protected] 
        
        //  ped->m_dwAnimGroup = savedAnimGroup;   
        0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0 
        
        0223: set_actor [email protected] health_to 99
    else 
        0247: load_model [email protected]         //  CStreaming::RequestModel(newModelID, 0x0C);
        038B: load_requested_models //  CStreaming::LoadAllRequestedModels(false);
    end
end
0AB2: cleo_return 0 

Call it like this:

0AB1: cleo_call @ChangePedModel params 2 param1 [email protected] param2 #SWAT

where [email protected] (param1) is a ped handle and MODEL_SWAT is just a showcase.

  • Like 2
Link to comment
Share on other sites

igotnothing
On 3/13/2023 at 8:16 PM, Jack said:
:changePedModel
//  [email protected] - actorHandle;   [email protected] - newModelID
0226: [email protected] = actor [email protected] health  
if [email protected] == 100
then
    //  if (CStreaming::ms_aInfoForModel[newModelID].m_nLoadState == LOADSTATE_LOADED) {
    if 0248:   model [email protected] available       
    then    
        //  DWORD savedAnimGroup = ped->m_dwAnimGroup;
        0A96: [email protected] = actor [email protected] struct 
        0A8E: [email protected] = [email protected] + 0x4D4   //  m_dwAnimGroup from CPed   
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
    
        //  ped->DeleteRwObject();  
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 
        0A8E: [email protected] = [email protected] + 0x20    //  DeleteRwObject  from CEntityVtbl    
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
        0AA6: call_method [email protected] struct [email protected] num_params 0 pop 0  
        
        //  ped->m_nModelIndex = -1; 
        0A8E: [email protected] = [email protected] + 0x22    //  m_nModelIndex from CEntity
        0A8C: write_memory [email protected] size 2 value -1 virtual_protect 0 
        
        //  ped->SetModelIndex(newModelID);
        0A8E: [email protected] = [email protected] + 0x14    //  SetModelIndex   from CEntityVtbl
        0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0  
        0AA6: call_method [email protected] struct [email protected] num_params 1 pop 0 [email protected] 
        
        //  ped->m_dwAnimGroup = savedAnimGroup;   
        0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0 
        
        0223: set_actor [email protected] health_to 99
    else 
        0247: load_model [email protected]         //  CStreaming::RequestModel(newModelID, 0x0C);
        038B: load_requested_models //  CStreaming::LoadAllRequestedModels(false);
    end
end
0AB2: cleo_return 0 

Call it like this:

0AB1: cleo_call @ChangePedModel params 2 param1 [email protected] param2 #SWAT

where [email protected] (param1) is a ped handle and MODEL_SWAT is just a showcase.

thank you so much

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

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