Jump to content

Nitro bind problem (AGAIN)


Mefisto_PL

Recommended Posts

I was write topic about it, but nobody answered me. I want to make bind to nitro (LPM). Castillo wrote me this code but it doesn't working..

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

Link to comment

i don't even find a nitro with id 2010

https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades

it's should be 1010 not 2010 -_-

addEventHandler("onPlayerJoin",root, 
function () 
   bindKey(source,"mouse1","down",nitro) 
end) 
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
   for index, player in ipairs(getElementsByType("player")) do 
        bindKey(player,"mouse1","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 ) 

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