Jump to content

who know more for upg


daKillar2000

Recommended Posts

Posted

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) 

Posted

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

Posted

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

Posted

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 ? :mrgreen:

Posted
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 :D, are you doing getElementsByType for all cars or something like that?

Posted
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 ? :mrgreen:

i have getElemtByType by player if i change it to vehicl1 vehicle2 etc... then not works:(

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...