Karuzo Posted January 19, 2014 Share Posted January 19, 2014 Hello MTA Scripting Community, I'm trying to make my own gamemode but learning with freeroam gamemode. So my question is : How can i save the Vehicle Upgrades of a Players car. I think i have it to do with ElementDatas , but ive heard that they were easy to manipulate. But i also don't want to make it with SQL . So, how should i save them ? Link to comment
xXMADEXx Posted January 19, 2014 Share Posted January 19, 2014 I suppose you could use setElementData and set the vehicle upgrades to the player, and get the ids using getVehicleUpgrades. Link to comment
Karuzo Posted January 19, 2014 Author Share Posted January 19, 2014 Well, ive never worked with elementDatas really, Could you explain it for me? Link to comment
xXMADEXx Posted January 19, 2014 Share Posted January 19, 2014 You could do something like this: local vehicle = the_vehicle addEventHandler ( "onVehicleEnter", vehicle, function ( p ) setElementData ( p, "VehicleUpgrades", getVehicleUpgrades ( source ) ) end ) Link to comment
Karuzo Posted January 19, 2014 Author Share Posted January 19, 2014 Ah! Ok now i understand it But, won't the upgrades been gone if he spawns the same car again? Link to comment
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