DogukanK Posted April 12, 2016 Posted April 12, 2016 function onVehicleEnter_handler( thePlayer, seat, jacked ) local account = getPlayerAccount(thePlayer) if not isGuestAccount(account) then local id = getAccountData(account,"wheel") addVehicleUpgrade(source,id) end end addEvent("onPlayerPickUpRacePickup", true) addEventHandler("onVehicleEnter",root,onVehicleEnter_handler) I have this code but I wanna too race mode car change too able give wheel for account database sorry bad english.
DogukanK Posted April 12, 2016 Author Posted April 12, 2016 ¿Dou you mean this? setAccountData no Im already setup account data but this code just working on start map I want always work for car change too wheel are put vehicle
_DrXenon Posted April 12, 2016 Posted April 12, 2016 There is no way anyone can understand what you want unless you make your self clear, If you cant speak proper english, Try talking in another language and maybe one scripter can help you! Cheers man
Captain Cody Posted April 12, 2016 Posted April 12, 2016 He wants the said upgrade id 'Wheel' to be placed on your car even if you change car or what not.
_DrXenon Posted April 12, 2016 Posted April 12, 2016 I am not good with cars and im on phone, but try this anyway: function onVehicleEnter_handler( ) for i,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) local veh = getPedOccupiedVehicle(player) if not isGuestAccount(account) then local id = getAccountData(acount,"wheel") if veh then for i,v in ipairs(getVehicleUpgrades(veh)) do if v ~= id then addVehicleUpgrade(veh,id) end end end end end end setTimer(onVehicleEnter_handler,100,0)
Shido Posted April 13, 2016 Posted April 13, 2016 I think i understand what you want, that code is fine, but there is a huge detail, i see this: addEvent("onPlayerPickUpRacePickup", true) but i dont see this: addEventHandler("onPlayerPickUpRacePickup",root,onVehicleEnter_handler) If its skipped the race gamemode wont read the function when you change the vehicle via race pickup (probably). Also remember that if theres no data for "wheel" on your account the function will fail.
DogukanK Posted April 13, 2016 Author Posted April 13, 2016 I am not good with cars and im on phone, but try this anyway: function onVehicleEnter_handler( ) for i,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) local veh = getPedOccupiedVehicle(player) if not isGuestAccount(account) then local id = getAccountData(acount,"wheel") if veh then for i,v in ipairs(getVehicleUpgrades(veh)) do if v ~= id then addVehicleUpgrade(veh,id) end end end end end end setTimer(onVehicleEnter_handler,100,0) gived error this code
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