Jump to content

Table


dugasz1

Recommended Posts

bazisok = { 
    { tulaj="dugasz1", pw="asd", model=5020, meret=1.5, zartX=310.5, zartY=-1554.69995, zartZ=32.28, zartRotX=0, zartRotY=0, zartRotZ=232, nyitX=310.5, nyitY=-1554.69995, nyitZ=37.28, nyitRotX=0, nyitRotY=0, nyitRotZ=232 }, 
    { tulaj="dugasz1", pw="asd", model=5020, meret=1.5, zartX=364.89941, zartY=-1469.59961, zartZ=32.26, zartRotX=0, zartRotY=0, zartRotZ=308, nyitX=364.89941, nyitY=-1469.59961, nyitZ=37.26, nyitRotX=0, nyitRotY=0, nyitRotZ=308 }, 
} 
  
function onResourceStart ( ) 
    bazisok[2]['pw'] = "test" 
    outputDebugString(bazisok[2]['pw']) 
end 
addEventHandler ( "onResourceStart", getRootElement(), onResourceStart ) 

Hello i wanna rewrite the pw in the table but how can i do it? it's working but dont save real in the file just in the memory then if i reload the script it stay pw=asd

Link to comment

The best thing to do with these kind of script is to save them somewhere else. You can do that in 3 ways (The 3 ways I can think of right now! )

xmlLoadFile -- using xml files to save character's and accounts 
executeSQLQuery -- mysql server 
msyql_query -- mysql server, but with a module 

For more information about the module, check out this link:

[url=https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL/mysql_query]https://wiki.multitheftauto.com/wiki/Mo ... ysql_query[/url] 

The reason that your password keeps changing back is because when you restart the source, the information will be refilled with your information. You can't hold a variable modified while the script restarts.

Link to comment
@tosfera well how dugasz1 say'd it's more better to use table with AccountData . xml file's are not the best solution to save such amount of data's.

Its just a way to save it, I didn't recommend doing it. Only told him that its a way of doing it. :D

I would only recommend XML if you're making marker's for shops, blips and so on. :)

Link to comment

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