Jump to content

getVehicleCompatibleUpgrades problem


Mizudori

Recommended Posts

When I enter car with getVehicleCompatibleUpgrades is doesn't show me a compatibleUpgrades it shows some upgrades for other cars.

It shows compatible list of spoilers for banshee when banshee doesn't have spoilers to upgrade.

  
  
function scriptOnPlayerEnterVehicle ( invehicle, seat, jacked ) 
  local upgrades = getVehicleCompatibleUpgrades ( invehicle ) 
  for upgradeKey, upgradeValue in ipairs ( upgrades ) do 
    outputChatBox ( getVehicleUpgradeSlotName ( upgradeValue ) .. ": " .. upgradeValue ) 
  end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), scriptOnPlayerEnterVehicle ) 
  
  

Proof that I am not insane here

fom8f4.jpg

1162 spl_a_j_b Spoiler Alien Jester

1163 spl_c_u_b Spoiler X-Flow Uranus

Link to comment

Try this:

function playEnterVeh ( theVehicle, seat ) 
  local upgrades = getVehicleCompatibleUpgrades ( theVehicle ) 
  for upgradeKey, upgradeValue in ipairs ( upgrades ) do 
    outputChatBox ( getVehicleUpgradeSlotName ( upgradeValue ) .. ": " .. upgradeValue ) 
  end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), playerEnterVeh ) 

Link to comment
Try this:
function playEnterVeh ( theVehicle, seat ) 
  local upgrades = getVehicleCompatibleUpgrades ( theVehicle ) 
  for upgradeKey, upgradeValue in ipairs ( upgrades ) do 
    outputChatBox ( getVehicleUpgradeSlotName ( upgradeValue ) .. ": " .. upgradeValue ) 
  end 
end 
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), playerEnterVeh ) 

same result as on my screen. Showing 1162,1163 ID spoilers etc.

Link to comment
Try using this along with the script, so it will get the specific upgrades for the specified model.
getVehicleModelFromName 

Hmm you mean if statement for some cars? This is only with spoilers so I will create spoilers table and use them for all cars with expections. Anyway thanks for help :)

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