addPedClothes | Multi Theft Auto: Wiki Skip to content

addPedClothes

Client-side
Server-side
Shared

Pair: getPedClothes

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function is used to set the current clothes on a ped.

Note

This function only works with peds using CJ skin (ID 0).

Syntax

addPedClothes ( )

Code Examples

server

This example adds a 'moto' helmet to a player when he gets on a nrg bike, and removes it when he gets off.

function onEnterVehicle ( theVehicle, seat, jacked )
if getElementModel ( theVehicle ) == 522 then -- if it's an nrg
addPedClothes ( source, "moto", "moto", 16 ) -- add the helmet
end
end
addEventHandler ( "onPlayerVehicleEnter", root, onEnterVehicle )
function onExitVehicle ( theVehicle, seat, jacked )
if getElementModel ( theVehicle ) == 522 then -- if it's an nrg
removePedClothes ( source, 16 ) -- remove the helmet
end
end
addEventHandler ( "onPlayerVehicleExit", root, onExitVehicle )

See Also