Jump to content

Bind ...


Mefisto_PL

Recommended Posts

I hate binds ... I can't make them so I want to somebody make me bind to nitro.. (Key: LPM)

  
function nitro ( thePlayer, commandName, id ) 
        if ( isPedInVehicle ( thePlayer ) ) then 
            local id = 1010 
            local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
            local success = addVehicleUpgrade ( theVehicle, id ) 
            if ( success ) then 
                outputConsole ( getVehicleUpgradeSlotName ( id ) .. " dodane.", thePlayer ) 
            else 
                outputConsole ( "Nieudana próba dodania nitro.", thePlayer ) 
            end 
        else 
            outputConsole ( "Musisz być w pojeździe !", thePlayer ) 
        end 
end 
addCommandHandler ( "nitro", nitro ) 

Please help me ! :<

Link to comment
addEventHandler("onPlayerJoin",root, 
function () 
   bindKey(source,"1","down",nitro) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
   for index, player in ipairs(getElementsByType("player")) do 
        bindKey(player,"1","down",nitro) 
   end 
end) 
  
function nitro ( thePlayer ) 
        if ( isPedInVehicle ( thePlayer ) ) then 
            local id = 1010 
            local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
            local success = addVehicleUpgrade ( theVehicle, id ) 
            if ( success ) then 
                outputConsole ( getVehicleUpgradeSlotName ( id ) .. " dodane.", thePlayer ) 
            else 
                outputConsole ( "Nieudana próba dodania nitro.", thePlayer ) 
            end 
        else 
            outputConsole ( "Musisz być w pojeździe !", thePlayer ) 
        end 
end 
addCommandHandler ( "nitro", nitro ) 

Edited by Guest
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...