Jump to content

Фары


Recommended Posts

  • Moderators
Posted (edited)
getVehicleOverrideLights + guiCreateStaticImage или dxDrawImage 

Edited by Guest
  • Moderators
Posted
спс) а можно поточнее?

Проверяешь состояние фар, если они выключены (см. параметры функции), то рисуй изображение.

Developers, Developers, Developers, Developers.... © Steve Balmer

http://www.lua.org/about.html

Quote
Please do not write it as "LUA", which is both ugly and confusing, because then it becomes an acronym with different meanings for different people. So, please, write "Lua" right!
Posted

Вот так:

function VehicleLightState ( playerSource )

local theVehicle = getPedOccupiedVehicle ( playerSource )

-- Check if the player is in any vehicle and if he is the driver

if theVehicle and getVehicleController ( theVehicle ) == playerSource then

local state = getVehicleLightState ( theVehicle )

if ( getVehicleOverrideLights ( veh ) ~= 2 ) then

guiCreateStaticImage( 20, 200, 100, 100, "imagename.png", false )

end

???

800px-VK.com-logo.svg.png
 
  • Moderators
Posted
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
        if ( theVehicle ) then 
            if getVehicleOverrideLights ( theVehicle ) == 2 then 
                --guiCreateStaticImage ( ... ) 
            end 
        end 
    end 
) 

Posted

Почему когда я выхожу из авто, картинка остаётся и почему немного подлагивает?

800px-VK.com-logo.svg.png
 
  • Moderators
Posted
Почему когда я выхожу из авто, картинка остаётся и почему немного подлагивает?

Мм, забудь про onClientRender, используй эти события:

onClientVehicleEnter / onClientVehicleExit

Для удаления картинки / проверки на ее наличие:

destroyElement / isElement 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...