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 in game nickname: [GFL]TimiimiT
triplesnake Posted January 27, 2012 Posted January 27, 2012 bec there is nothing called addNitro make it addUpgrade("1010") http://www.blueptp.com/credit.php?pseudo=wedo331
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! in game nickname: [GFL]TimiimiT
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) My resources : playerpartFromName: Exported function.
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 http://www.blueptp.com/credit.php?pseudo=wedo331
Timiimit Posted January 27, 2012 Author Posted January 27, 2012 not working in game nickname: [GFL]TimiimiT
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 Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
Timiimit Posted January 27, 2012 Author Posted January 27, 2012 (edited) its working! Edited January 27, 2012 by Guest in game nickname: [GFL]TimiimiT
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 http://www.blueptp.com/credit.php?pseudo=wedo331
Klesh Posted January 27, 2012 Posted January 27, 2012 My code didn't work? Test it. My resources : playerpartFromName: Exported function.
Timiimit Posted January 27, 2012 Author Posted January 27, 2012 thx for all! in game nickname: [GFL]TimiimiT
BriGhtx3 Posted January 27, 2012 Posted January 27, 2012 Timiit cause its serverside. Just change the onPlayerVehicleEnter to onClientPlayerVehicleEnter Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
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) http://www.blueptp.com/credit.php?pseudo=wedo331
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 Currently working on gamemodes : Reallife Script 70% Breakout Script 10%
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 http://www.blueptp.com/credit.php?pseudo=wedo331
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