PL/getPedClothes

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.

Ta funkcja zwraca teksturę i model ubrań wybranego typu aktualnie noszonych przez NPC.

Składnia

string string getPedClothes ( ped thePed, int clothesType )

Składnia OOP Pomocy, nie rozumiem!

Metoda: ped:getClothes(...)
Odpowiednik: addPedClothes

Wymagane argumenty

  • thePed: NPC którego ubrania chcemy przetworzyć.
  • clothesType: Typ/slot ubrań które chcesz pobrać.
Clothing Types
  • 0: SHIRT
  • 1: HEAD
  • 2: TROUSERS
  • 3: SHOES
  • 4: TATTOOS_LEFT_UPPER_ARM
  • 5: TATTOOS_LEFT_LOWER_ARM
  • 6: TATTOOS_RIGHT_UPPER_ARM
  • 7: TATTOOS_RIGHT_LOWER_ARM
  • 8: TATTOOS_BACK
  • 9: TATTOOS_LEFT_CHEST
  • 10: TATTOOS_RIGHT_CHEST
  • 11: TATTOOS_STOMACH
  • 12: TATTOOS_LOWER_BACK
  • 13: NECKLACE
  • 14: WATCH
  • 15: GLASSES
  • 16: HAT
  • 17: EXTRA

Wartości zwrotne

Funkcja zwraca dwa ciągi znaków, teksturę ubrania i model. Pierwsza wartość będzie wynosić false jeśli gracz nie posiada ubrań tego typu lub został podany nieprawidłowy gracz/ped.

Przykład

Click to collapse [-]
Serwer

Ta funkcja wyświetla teksturę i model ubrań gracza który wpisał /clothes <typ>. Na przykład: "clothes 3" dla butów.

function getClothes ( source, key, clothesType )
    local texture, model = getPedClothes ( source, clothesType )
    if ( texture and model ) then
        outputChatBox ( getPlayerName(source) .. " nosi " .. texture .. " " .. model ..
                        " na jego " .. getClothesTypeName(clothesType), source )
    else
        outputChatBox ( "Nieprawidłowy typ.", source )
    end
end
addCommandHandler ( "clothes", getClothes )

Zobacz także