About This File
Requires RAGE Multiplayer 1.1.0 and above.
This resource adds 2 new functions to mp.Object that provides texture variation sync.
If you don't know the purpose of prop texture variations, you should check out GTA Online's stunt maps/props and yacht styles.
Installing
- Put the files you downloaded in their respective places
- Add require('texturevariation') to client_packages/index.js
- All done
Serverside API
/** * Sets the texture variation of the object. * @param {number} textureVariation Texture variation index. */ object.setTextureVariation(textureVariation); /** * Returns the texture variation of the object. * @return {number} */ object.getTextureVariation();
Example
This snippet was used during development:
const gamerChair = mp.objects.new("gr_prop_highendchair_gr_01a", new mp.Vector3(-425.517, 1123.620, 325.8544)); gamerChair.setTextureVariation(1); mp.events.addCommand("chaircol", (player, colorIndex) => { colorIndex = Number(colorIndex); if (!Number.isInteger(colorIndex)) { player.outputChatBox("Usage: /chaircol [color index]"); return; } gamerChair.setTextureVariation(colorIndex); }); mp.events.addCommand("spawntube", (player, colorIndex) => { colorIndex = Number(colorIndex); if (!Number.isInteger(colorIndex)) { player.outputChatBox("Usage: /spawntube [color index]"); return; } const tube = mp.objects.new("bkr_prop_biker_tube_xxs", player.position); tube.setTextureVariation(colorIndex); });