setElementModel
Server
Changes the model of a ped or player, and of its children.
bool setElementModel(element element, string model)
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The ped or player. |
| model | string | The ped model's name. |
Returns
true if the element's own model changed, false if the model is the same, is not a ped model, the element is not a ped or player, or a handler cancelled the change.
Fires onElementModelChange with the old and the new model. Cancelling the event goes back to the old model.
Example
addCommandHandler("skin", function(player, command, model)
if model and not setElementModel(player, model) then
outputDebugString("unknown ped model: " .. model)
end
end)