PL/addPedClothes: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (ThePiotrek moved page PL/AddPedClothes to PL/addPedClothes)
mNo edit summary
 
Line 41: Line 41:
==Zobacz także==
==Zobacz także==
{{Ped functions}}
{{Ped functions}}
[[ar:addPedClothes]]
[[en:AddPedClothes]]
[[hu:addPedClothes]]
[[pl:AddPedClothes]]
[[RO:addPedClothes]]

Latest revision as of 18:32, 21 February 2021

[[{{{image}}}|link=|]] Notatka: Ta funkcja działa tylko na skinie CJ'a (ID 0).

Ta funkcja służy do zmiany ubrań noszonych przez NPC.

Składnia

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

Składnia OOP Pomocy, nie rozumiem!

Metoda: ped:addClothes(...)
Odpowiednik: getPedClothes

Wymagane argumenty

  • thePed: NPC którego ubrania chcesz zmienić.
  • clothesTexture: Ciąg znaków który określa teksturę ubrania. Zerknij na katalog odzieży.
  • clothesModel: Ciąg znaków który określa model ubrania. Zerknij na katalog odzieży.
  • clothesType: Liczba całkowita reprezentująca slot/typ odzieży która ma zostać dodana. Zerknij na katalog odzieży.

Wartości zwrotne

Funkcja zwraca true jeśli ubrania zostały pomyślnie dodane, w innym przypadku zwraca false.

Przykład

Click to collapse [-]
Serwer

Ten przykład dodaje graczu kask motocyklowy kiedy wejdzie on na NRG-500, i usuwa go kiedy gracz z niego zejdzie.

function onEnterVehicle ( theVehicle, seat, jacked )
    if getElementModel ( theVehicle ) == 522 then         -- jeśli to nrg
        addPedClothes ( source, "moto", "moto", 16 )   -- dodaj kask
    end
end
addEventHandler ( "onPlayerVehicleEnter", root, onEnterVehicle )

function onExitVehicle ( theVehicle, seat, jacked )
    if getElementModel ( theVehicle ) == 522 then      -- jeśli to nrg
        removePedClothes ( source, 16 )              -- usuń kask
    end
end
addEventHandler ( "onPlayerVehicleExit", root, onExitVehicle )

Zobacz także