SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Funkcje wspólne
  3. setElementRotation

Funkcja

setElementRotation

Ustawia obrót elementu w stopniach. Na kliencie obraca własną postać w tej samej klatce (bez teleportu) oraz obiekty klienta.

Składnia

bool setElementRotation(element theElement, float rotX, float rotY, float rotZ)

Argumenty

theElementelement
Element.
rotXfloat
Obrót X.
rotYfloat
Obrót Y.
rotZfloat
Obrót Z (kierunek).

Różnice względem MTA:SA

  • Tych argumentów z MTA:SA tu nie ma: string rotOrder = "default", bool conformPedRotation = false

W MTA:SA

setElementRotation(element theElement, float rotX, float rotY, float rotZ, string rotOrder = "default", bool conformPedRotation = false)

Zwraca

true przy powodzeniu.

Przykład

addCommandHandler("odwroc", function(player)
    local veh = getPedOccupiedVehicle(player)
    if veh then
        local _, _, rz = getElementRotation(veh)
        setElementRotation(veh, 0, 0, rz)
    end
end)

Zobacz też