Player::setProp: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 1: Line 1:
This function sets the prop for the player
This function sets the prop for the player. Warning: setProp not use in 1.1, only in 0.3.7.
== Syntax ==
== Syntax ==
<pre>
<pre>

Revision as of 20:35, 10 June 2020

This function sets the prop for the player. Warning: setProp not use in 1.1, only in 0.3.7.

Syntax

player.SetAccessories(propID, drawableID, textureID)

Props:

  • 0 - Helmets, hats, earphones, masks
  • 1 - Glasses
  • 2 - Ear accessories
  • 6 - Watches
  • 7 - Bracelets

Parameters

  • propID: Int
  • drawableID: Int
  • textureID: Int

Example

Creates a command called setprops which lets you try out different props

Server-Side
mp.events.addCommand('setprop', (player, args) => {
	if(!args || isNaN(args[0]) || isNaN(args[1]) || isNaN(args[2])){
		return player.outputChatBox("Syntax: /setprop [propID] [drawableID] [textureID]");
	}

	let cmd = args.split(' ');
	player.SetAccessories(parseInt(cmd[0]), parseInt(cmd[1]), parseInt(cmd[2]));
});

See also