Jump to content

Help me!


Timiimit

Recommended Posts

Posted (edited)

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

in game nickname: [GFL]TimiimiT

Posted

???

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!

in game nickname: [GFL]TimiimiT

Posted
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

Currently working on gamemodes :

  • Reallife Script 70%
  • Breakout Script 10%
Posted
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

Posted

Timiit cause its serverside. Just change the onPlayerVehicleEnter to onClientPlayerVehicleEnter

Currently working on gamemodes :

  • Reallife Script 70%
  • Breakout Script 10%

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