Player Model

The player character is referred to in the script as Game.Player. Game.Player can perform different functions, including changing the avatar model. Change the 3D model of your character by using the ChangeModel function. The function needs a model ID, in order to load the model file of your game character. You can browse through this list of models to find the one you want to try (note: not all models might load).

These models are all PedHashes, which are basically unique ID numbers for each avatar model. Copy the name of the model below the image and add it to PedHash. For example if you choose the model Poodle, you’ll need to write PedHash.Poodle.

To change the model of your player character into a poodle you can write the following function:

Game.Player.ChangeModel(PedHash.Poodle);

Add this line inside the onKeyDown event, triggered by the pressing of the H key.

using System;
using System.Windows.Forms;
using System.Drawing;
using GTA;
using GTA.Math;
using GTA.Native;

namespace moddingTutorial
{
    public class moddingTutorial : Script
    {
        public moddingTutorial()
        {
            this.Tick += onTick;
            this.KeyUp += onKeyUp;
            this.KeyDown += onKeyDown;
        }

        private void onTick(object sender, EventArgs e) 
        {
             //what is inside here gets executed continuously 
        }

        private void onKeyUp(object sender, KeyEventArgs e)/
        {
             //what is inside here is executed only when we release a key
        }

        private void onKeyDown(object sender, KeyEventArgs e) 
        {
             //what is inside here is executed only when we press a key

            if(e.KeyCode == Keys.H) //when pressing the 'H' key
            {
                //change the player character into a different model
                Game.Player.ChangeModel(PedHash.Poodle); 
            }
        }
    }
}

Remember to press F6 to update your script. In your game press F4 to bring up the console, type Reload() and press Enter to reload the script in GTA V.

Try to select different models and assign them to different keys to change the model of your character. Use keys that are not already implemented in the game controls to avoid clashes with built in operations.