HU/addPedClothes

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

[[{{{image}}}|link=|]] Note: Ez a function egyedül csak a CJ skinnel működik (ID 0).

Ezzel a funkcióval megváltoztathatjuk egy gyalogos aktuális ruházatát.

Szintaxis

bool addPedClothes ( ped thePed, string clothesTexture, string clothesModel, int clothesType )

OOP Syntax Help! I don't understand this!

Method: ped:addClothes(...)
Counterpart: getPedClothes


Kötelező paraméterek

  • thePed: A gyalogos, akinek a ruháját meg akarjuk változtatni.
  • clothesTexture: Egy string, mely meghatározza a változtatandó ruhák texturáját. Lásd clothes catalog.
  • clothesModel: Egy string, mely meghatározza a változtatandó ruhák modeljét. Lásd clothes catalog.
  • clothesType: Egy egész szám, mely a hozzáadásra kerülő ruha típusát/helyét határozza meg. Lásd clothes catalog.

Visszatérési érték

Visszatérési értéke true, ha sikeresen megváltoztattuk egy gyalogos aktuális ruházatát, egyébként false.

Példa

Click to collapse [-]
Server

Ez a példa egy 'moto' sisakot rak egy játékosra, amikor egy nrg-ra ül fel, majd eltávolítja azt, ha leszáll róla.

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 )

Lásd még

Fordította