Mefisto_PL Posted January 1, 2012 Posted January 1, 2012 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 )
TAPL Posted January 1, 2012 Posted January 1, 2012 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 )
Mefisto_PL Posted January 1, 2012 Author Posted January 1, 2012 >.< My code have 1010 but I give Castillo code >.< Okey Thanks (Castillo too <3)
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