- Documentation
- Shared functions
- setElementModel
Function
setElementModel
Changes the element's model. For players and peds you can also pass the clothing and skin variant (0-3); without them the server picks one so everyone sees the same.
Syntax
bool setElementModel(element theElement, int model [, int clothes = losowy, int skin = losowy])Arguments
theElementelement- The element.
modelint- Model number.
clothesint, optional = losowy- Clothing variant 0-3.Not in MTA:SA
skinint, optional = losowy- Skin variant 0-3.Not in MTA:SA
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
setElementModel(element theElement, int model)Returns
true on success.
Example
addCommandHandler("skin", function(player, cmd, id)
if not setElementModel(player, tonumber(id) or 0) then
outputChatBox("Nieprawidłowy skin.", player, 255, 0, 0)
end
end)
See also
getElementModelReturns the element's model. For a player-1means CJ in the outfit chosen in the launcher, and0plain CJ.setPedVariantSets a pedestrian's appearance variant: the set of clothes and the skin tone. Every ped model in the Definitive Edition has 4 clothing variants (0-3) and 4 skin variants (0-3); the change is visible to every player. An omitted argument is randomised, which is whycreatePedgives each NPC a random look. Works for NPCs and for players using a ped skin.