Jump to content

¿Por qué no funciona?


Malganys21

Recommended Posts

Buenas, hace poco empecé con la parte de scripting en MTA e intenté hacer un pequeño script que al entrar, cree un bind para que cuando suba a un vehículo equipe el nitro pero no funciona.

 

script:

Spoiler

function nitro ( key, keyState )
  local veh = getPedOccupiedVehicle ( localPlayer )
  if ( keyState == "up" ) then
    addVehicleUpgrade ( veh, 1010 )
  end
end

function bindKeys ()
  bindKey ( "mouse1", "up", nitro )
end
addEventHandler ( "onPlayerJoin", getRootElement(), bindKeys )

 

Link to comment
function nitro ()
	local veh = getPedOccupiedVehicle ( source )
	addVehicleUpgrade ( veh, 1010 )
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), nitro )


function bindKeys ()
  bindKey(source, "mouse1", "down", nitro)
end
addEventHandler ( "onPlayerJoin", getRootElement(), bindKeys )

 

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