PL/removePedClothes: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
{{PL/Shared function}}
{{PL/Shared function}}
Ta funkcja służy do usuwania ubrań wybranego typu [[ped|NPC]]. Usunie je nawet jeśli clothesTexture i clothesModel nie są określone, lub jeśli oznaczają obecne ciuchy na tym slocie.
Ta funkcja służy do usuwania wybranego typu ubrań [[ped|NPC]]. Usunie je nawet jeśli clothesTexture i clothesModel nie są określone, lub jeśli oznaczają obecne ciuchy na tym slocie.


==Składnia==
==Składnia==

Revision as of 18:50, 19 July 2016

Ta funkcja służy do usuwania wybranego typu ubrań NPC. Usunie je nawet jeśli clothesTexture i clothesModel nie są określone, lub jeśli oznaczają obecne ciuchy na tym slocie.

Składnia

bool removePedClothes ( ped thePed, int clothesType, [ string clothesTexture, string clothesModel ] )

Składnia OOP Pomocy, nie rozumiem!

Metoda: ped:removeClothes(...)

Wymagane argumenty

  • thePed: NPC któremu chcesz usunąć ubrania.
  • clothesType: slot/typ ubrań do usunięcia. Zerknij na katalog ubrań.

Opcjonalne argumenty

  • clothesTexture: (Tylko po stronie serwera) Ciąg znaków oznaczający teksturę ubrania do usunięcia. Zerknij na katalog ubrań.
  • clothesModel: (Tylko po stronie serwera) Ciąg znaków oznaczający model ubrań do usunięcia. Zerknij na katalog ubrań.

Wartości zwrotne

Funkcja zwraca true jeśli wartości zostały pomyślnie usunięte lub false jeśli nie.

Przykład

Click to collapse [-]
Serwer

Ten przykład da graczowi kask motorowy gdy wsiądzie on na nrg-500 i usunie go, gdy gracz z niego zejdzie.

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

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

Zobacz także

Shared