Timiimit Posted January 27, 2012 Posted January 27, 2012 (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 January 27, 2012 by Guest
triplesnake Posted January 27, 2012 Posted January 27, 2012 bec there is nothing called addNitro make it addUpgrade("1010")
Timiimit Posted January 27, 2012 Author Posted January 27, 2012 ??? 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!
Klesh Posted January 27, 2012 Posted January 27, 2012 addEventHandler("onPlayerVehicleEnter", getRootElement(), function (thePlayer) if (getPedOccupiedVehicle(thePlayer) then theVehicle = getPedOccupiedVehicle(player) addVehicleUpgrade(theVehicle, 1010) end end)
triplesnake Posted January 27, 2012 Posted January 27, 2012 (edited) function addNitro(player) if getPedOccupiedVehicle(player) then theVehicle = getPedOccupiedVehicle(player) addVehicleUpgrade ( theVehicle, 1010 ) end end addEventHandler ( "onClientVehicleEnter",addNtiro) Edited January 27, 2012 by Guest
BriGhtx3 Posted January 27, 2012 Posted January 27, 2012 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
Timiimit Posted January 27, 2012 Author Posted January 27, 2012 (edited) its working! Edited January 27, 2012 by Guest
triplesnake Posted January 27, 2012 Posted January 27, 2012 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 sorry for interfering
BriGhtx3 Posted January 27, 2012 Posted January 27, 2012 Timiit cause its serverside. Just change the onPlayerVehicleEnter to onClientPlayerVehicleEnter
triplesnake Posted January 27, 2012 Posted January 27, 2012 urw btw the problem was the 1 net to the addNitro fixed xthepr0mise code is shorter and better tho he is just rude (jking)
BriGhtx3 Posted January 27, 2012 Posted January 27, 2012 Haha No normally I'm not rude Just wanted to "show" him that it is wrong ;D
triplesnake Posted January 27, 2012 Posted January 27, 2012 it seemed more like "shoot" him not "show" i bet he won't make mistakes again lool
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