ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. 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