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

last three should be attached to getRootElement() i think, as i dont think your resource is parent of all vehicles and players?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Sure: Click here

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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
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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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:(

Posted

post whole script. HERE.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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...