Jump to content

Help me!


Timiimit

Recommended Posts

Hi!

I am making a script that adds nitro to vehicle when you enter.

This is what i have:

  
addEventHandler ( "onClientVehicleEnter", addNitro ( source ) 
  
    local driver = getVehicleOccupant ( source ) 
  
    if ( driver ) then 
    addVehicleUpgrade ( theVehicle, 1010 ) 
    end 
end) 
  

But it doesn't work anyone know what is wrong?

It doesn't says that there is error.

Edited by Guest
Link to comment

???

you mean it should be like this?

  
addEventHandler ( "onClientVehicleEnter",  
  
    local driver = getVehicleOccupant ( source ) 
  
    if ( driver ) then 
    addVehicleUpgrade ( theVehicle, 1010 ) 
    setTimer( addVehicleUpgrade ( theVehicle, 1010 ), 20000, 0) 
    end 
end) 
  

It's not working!

Link to comment
addEventHandler("onPlayerVehicleEnter", getRootElement(), 
function (thePlayer) 
    if (getPedOccupiedVehicle(thePlayer) then 
        theVehicle = getPedOccupiedVehicle(player) 
        addVehicleUpgrade(theVehicle, 1010) 
    end 
end) 
  

Link to comment
addEventHandler("onPlayerVehicleEnter", getRootElement(), 
function (theVehicle) 
        addVehicleUpgrade(theVehicle, 1010) 
end) 
  

This is enough.

You dont need that whole code Klesh. And the getPedOccupiedVehicle part is dump, cause you enter a car.

Also thePlayer is totally wrong cause in your case the thePlayer is a vehicle.

I dont want to sound rude, but its rubbish code

Link to comment
addEventHandler("onPlayerVehicleEnter", getRootElement(), 
function (theVehicle) 
        addVehicleUpgrade(theVehicle, 1010) 
end) 
  

This is enough.

You dont need that whole code Klesh. And the getPedOccupiedVehicle part is dump, cause you enter a car.

Also thePlayer is totally wrong cause in your case the thePlayer is a vehicle.

I dont want to sound rude, but its rubbish code

lol no need to judge him just help the guy :D sorry for interfering

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