Jump to content

Фары


Recommended Posts

Вот так:

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

???

Link to comment
  • Scripting Moderators
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
        if ( theVehicle ) then 
            if getVehicleOverrideLights ( theVehicle ) == 2 then 
                --guiCreateStaticImage ( ... ) 
            end 
        end 
    end 
) 

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

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

onClientVehicleEnter / onClientVehicleExit

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

destroyElement / isElement 

Link to comment

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...