Jump to content

Bad argument @'bindKey'


saluta

Recommended Posts

Spoiler
how to turn off the headlights on the server side, because if on the client side, then the person who turned it on only sees and the rest do not see.

function consoleVehicleLights ( thePlayer ) 
    local playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
    if playerVehicle then 
        if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then 
            setVehicleOverrideLights ( playerVehicle, 2 ) 
        else 
            setVehicleOverrideLights ( playerVehicle, 1 ) 
        end 
    end 
end 
addCommandHandler ( "vehiclelights", consoleVehicleLights ) 
addEventHandler ( "onResourceStart", root, consoleVehicleLights)
bindKey("l", "down", "vehiclelights", thePlayer ) 

 

hi, help please.

Spoiler

spacer.png

 

Link to comment
function consoleVehicleLights (thePlayer) 
    local playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
    if playerVehicle then 
        if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then 
            setVehicleOverrideLights ( playerVehicle, 2 ) 
        else 
            setVehicleOverrideLights ( playerVehicle, 1 ) 
        end 
    end 
end 
addCommandHandler ( "vehiclelights", consoleVehicleLights )  

addEventHandler("onResourceStart", resourceRoot,
    function()
       for _,player in ipairs(getElementsByType("player")) do
       	  bindKey(player, "l", "down", "vehiclelights") 
       end
    end
)

do it this way

  • Thanks 1
Link to comment
16 hours ago, Burak5312 said:
function consoleVehicleLights (thePlayer) 
    local playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
    if playerVehicle then 
        if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then 
            setVehicleOverrideLights ( playerVehicle, 2 ) 
        else 
            setVehicleOverrideLights ( playerVehicle, 1 ) 
        end 
    end 
end 
addCommandHandler ( "vehiclelights", consoleVehicleLights )  

addEventHandler("onResourceStart", resourceRoot,
    function()
       for _,player in ipairs(getElementsByType("player")) do
       	  bindKey(player, "l", "down", "vehiclelights") 
       end
    end
)

do it this way

Great work bro, do you want to return to the project? i'll do  advertising right now

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