NassurL Posted July 4, 2019 Share Posted July 4, 2019 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
Jonas^ Posted July 4, 2019 Share Posted July 4, 2019 (edited) Você esta usando eventos do server no client, e no client só existe localPlayer. Edited July 4, 2019 by Jonas^ 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now