daKillar2000 Posted September 13, 2010 Share Posted September 13, 2010 Heey i maked a automatic vehicleupgradesaver but do u know more addenevthandler? i have this addevent, addEventHandler ( "onResourceStop", getRootElement(getThisResource()), saveStuff) addEventHandler ( "onPreResourceStart", getRootElement(getThisResource()), saveStuff) addEventHandler ( "onPlayerLogout", getRootElement(getThisResource()), saveStuff) addEventHandler ( "onPlayerQuit", getRootElement(getThisResource()), saveStuff) addEventHandler ( "onVehicleExplode", getRootElement(getThisResource()), saveStuff) Link to comment
dzek (varez) Posted September 13, 2010 Share Posted September 13, 2010 last three should be attached to getRootElement() i think, as i dont think your resource is parent of all vehicles and players? Link to comment
daKillar2000 Posted September 13, 2010 Author Share Posted September 13, 2010 it works or all players;) but meaby u know more addvents Link to comment
dzek (varez) Posted September 13, 2010 Share Posted September 13, 2010 Sure: Click here Link to comment
daKillar2000 Posted September 13, 2010 Author Share Posted September 13, 2010 i have only one problem when he is in car then he only saves if he exit the vehicle and explode car he gives warning this warning WARNING: Player_menu\guiS.lua:948: Bad argument @ 'getElementID' this the line: if (getElementID(getPedOccupiedVehicle(v)) == getAccountName (getPlayerAccount(v))) then Link to comment
dzek (varez) Posted September 13, 2010 Share Posted September 13, 2010 why are you using getPedOccupiedVehicle ? source is the vehicle that exploded in onVehicleExplode event. i think you need to prepare 3 separate functions for onResourceStart/Stop, onPlayerQuit/Logout, onVehicleExplode - so source can match the things you want it to be Link to comment
daKillar2000 Posted September 13, 2010 Author Share Posted September 13, 2010 ok thats fixed but when he saves one car he add the upgrades on all cars when spawn O_o and when he explode he don't get the upgrades Link to comment
daKillar2000 Posted September 13, 2010 Author Share Posted September 13, 2010 check this for car 1: for i,v1 in ipairs (getElementsByType ("player")) do this for car2: for i,v2 in ipairs (getElementsByType ("player")) do this for car3: for i,v3 in ipairs (getElementsByType ("player")) do this for car4: for i,v4 in ipairs (getElementsByType ("player")) do the problem is when i upgrade car1 then he do the upgrades too on car2 car3 and car4, how fix it ? Link to comment
daKillar2000 Posted September 14, 2010 Author Share Posted September 14, 2010 look he works fine but only he add it on all vehicles Link to comment
Castillo Posted September 14, 2010 Share Posted September 14, 2010 look he works fine but only he add it on all vehicles lol i don't see anything about that video, just that a car got to sky like a helicopter O_o Link to comment
daKillar2000 Posted September 15, 2010 Author Share Posted September 15, 2010 omg this a movie if i show upgrade saves works but he add it on all vehicles O_o how to fix Link to comment
Castillo Posted September 15, 2010 Share Posted September 15, 2010 omg this a movie if i show upgrade saves works but he add it on all vehicles O_o how to fix I don't get something , are you doing getElementsByType for all cars or something like that? Link to comment
daKillar2000 Posted September 15, 2010 Author Share Posted September 15, 2010 check this for car 1: for i,v1 in ipairs (getElementsByType ("player")) do this for car2: for i,v2 in ipairs (getElementsByType ("player")) do this for car3: for i,v3 in ipairs (getElementsByType ("player")) do this for car4: for i,v4 in ipairs (getElementsByType ("player")) do the problem is when i upgrade car1 then he do the upgrades too on car2 car3 and car4, how fix it ? i have getElemtByType by player if i change it to vehicl1 vehicle2 etc... then not works:( Link to comment
dzek (varez) Posted September 15, 2010 Share Posted September 15, 2010 post whole script. HERE. 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