RedM Natives

SET_PLAYER_MODEL

Set the model for a specific Player.

Hash0x774A4C54
Runtime nameSetPlayerModel
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void SET_PLAYER_MODEL(Player player, Hash model);

Parameters

NameTypeDescription
playerPlayer

The player to set the model for

modelHash

The model to use

Returns void

Description

Cfx.re native reference

Set the model for a specific Player. Note that this will destroy the current Ped for the Player and create a new one, any reference to the old ped will be invalid after calling this. As per usual, make sure to request the model first and wait until it has loaded.

This is the server-side RPC native equivalent of the client native SET_PLAYER_MODEL.

Usage

Lua
SetPlayerModel(player, model)

-- always works, by hash
Citizen.InvokeNative(0x774a4c54, player, model)
JavaScript and C#
JavaScript
SetPlayerModel(player, model);

// by hash
Citizen.invokeNative('0x774a4c54', player, model);
C#
Function.Call((Hash)0x774a4c54, player, model);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.