SetPlayerClothingPreset: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
-- Server side | |||
AddCommand("preset", function (playerId, presetId) | |||
if presetId == nil then | |||
return AddPlayerChat(playerid, "Usage: /preset <preset id between 1 to 30>") | |||
end | |||
CallRemoteEvent("SetClientClothingPreset", playerId, presetId) | |||
end) | |||
-- Client side | |||
AddRemoteEvent("SetClientClothingPreset", function (presetId) | |||
SetPlayerClothingPreset(GetPlayerId(), presetId) | |||
end) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[ClothingExample]] | * [[ClothingExample]] |
Revision as of 14:51, 18 December 2019
Description
This function sets a predefined clothing preset on a player. This is for people who are not interested in setting each clothing item ClothingExample.
Syntax
SetPlayerClothingPreset(player, clothing_preset)
Parameters
- player
The player identifier. - clothing_preset
The clothing preset .
Return Value
- Returns true on success.
Example
-- Server side
AddCommand("preset", function (playerId, presetId)
if presetId == nil then
return AddPlayerChat(playerid, "Usage: /preset <preset id between 1 to 30>")
end
CallRemoteEvent("SetClientClothingPreset", playerId, presetId)
end)
-- Client side
AddRemoteEvent("SetClientClothingPreset", function (presetId)
SetPlayerClothingPreset(GetPlayerId(), presetId)
end)