Jump to content

AJUDA COM BINDKEY


Recommended Posts

function consoleVehicleLights ()
 if isPedInVehicle(getLocalPlayer()) then -- checks is the player in vehicle if yes, then: 
       playerVehicle = getPedOccupiedVehicle ( getLocalPlayer() )       -- get the local player's vehicle
       if ( playerVehicle ) then                                        -- if he was in one
           if ( getVehicleOverrideLights ( playerVehicle ) ~= 2 ) then  -- if the current state isn't 'force on'
               setVehicleOverrideLights ( playerVehicle, 2 )            -- force the lights on
           else
               setVehicleOverrideLights ( playerVehicle, 1 )            -- otherwise, force the lights off
           end
       end
   end
end


function PlayerOnS ()
bindKey(source,"L","down",consoleVehicleLights)
end
addEventHandler("onPlayerJoin",root,PlayerOnS)

function JogadoresOnJ ()
local jogadores = getElementsByType ("player")
for k,v in ipairs(jogadores) do
bindKey(v,"F2","down",consoleVehicleLights)
end
end

JogadoresOnJ()

Tentei fazer um script com bindKey mas não deu certo, Alguém pode me ajudar ?

debug script: WARNING: Bad argument @'bindKey' [Expected string at argument 1, got player]

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