Jump to content

addVehicleUpgrade


Blinker.

Recommended Posts

hello folks , i was trying to add a vehicle upgrade when the player spawn but it's not working.

Errors : @ addVehicleUpgrade(veh,id) | expected ped at argument 1 got nil

so i guess it's not detecting the ped to detect the Vehicle he's using.

i'm using the following:

  
-- id is defined. 
addEventHandler("onPlayerSpawn",root, 
function() 
outputChatBox'1' 
local veh = getPedOccupiedVehicle( source ) 
addVehicleUpgrade(veh,id) 
  
end) 
  

Any help would be greatly appreciated

Link to comment

Hello TAPL ,

i tried using setTimer , and aslo it's not working.

the error is @ local veh = getPedOccupiedVehicle( source ) actually.

so i wanted to reduce the size of the error since the error is @ local veh = getPedOccupiedVehicle( source ) and it's causing the addVehicleUpgrade(veh,id) to stop working tho.

Link to comment
  
  
-- id is defined. 
addEventHandler("onPlayerSpawn", root, 
     function() 
         outputChatBox('1', source) 
         local veh = getPedOccupiedVehicle( source ) 
         if veh then 
               addVehicleUpgrade( veh, id ) 
         else 
               return outputChatBox("noveh") 
          end 
     end 
) 
  

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