Array

Started by FinchDon, Sep 17, 2015, 03:34 PM

Previous topic - Next topic

FinchDon

No Mashreq I Didnt save it in Database i just save them on array pstats array BFME Class When did  i do !v it show 2 Bfme coin on my rejoin it show coins 0
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

Because you are saving it on a database, but not loading it when a player joins, so how to know it'll work or not?
Post your onPlayerJoin, and the save query option along with the playerclass
oh no

DizzasTeR

Quote from: FinchDon on Sep 18, 2015, 09:56 AMNo Mashreq I Didnt save it in Database i just save them on array pstats array BFME Class When did  i do !v it show 2 Bfme coin on my rejoin it show coins 0

Tell me, Why do you keep Kills, Deaths, Cash etc for each player in database? Yes, because you want to load it later, the same way you create an array for these to load a class on them the same way as your BFME class, then how do you expect the BMFE class data to get saved without saving it in database?

If even now you didn't get what I mean then don't ask for help again, first try to improve your English so you can understand the solution which people post here for you.

FinchDon

#18
I understand Doom i add Coins in Accounts Table But i increase them by pstats[ player.ID ].BFME += 9999; This Set it but can't Update it How can i? i Mean On My rejoin it Become 0

I use that

QuerySqL( sqluteDb, "UPDATE Accounts Set Coins= " + pstats[ player.ID ].BFME + " WHERE Name= " + player.Name.tolower(); + " ); Something Like this It show no error but also no Change in Coins
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Mashreq

Answer to questions which I asked before:  Is there a column called BFME in your table which stores accounts.
If yes; are you saving the score when you leave the server?

FinchDon

Yes I save on Leave But its NOt BFME coloumn it is Coins
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

Have u ever thought about creating a table?
oh no

Kratos_


I didn't save anything in database .
Quote from: FinchDon on Sep 18, 2015, 09:56 AMI Didnt save it in Database i just save them on array pstats array BFME Class



But , I'm saving them too .
Quote from: FinchDon on Sep 18, 2015, 11:00 AMi add Coins in Accounts Table But i increase them by pstats[ player.ID ].BFME += 9999; This Set it but can't Update it How can i? i Mean On My rejoin it Become 0
I use that
QuerySqL( sqluteDb, "UPDATE Accounts Set Coins= " + pstats[ player.ID ].BFME + " WHERE Name= " + player.Name.tolower(); + " ); Something Like this It show no error but also no Change in Coins

Be more clear .
In the middle of chaos , lies opportunity.

Thijn

In order to keep something for when you leave, you have to... save it somewhere. Just adding a variable to a class won't let it be saved. You have to edit stuff.

There should be 2 functions you have to edit: The save function, and the load function.
Try to find those 2 functions and add your column to it. You don't have to create another query, just append to the current one. There's no need to make 2 if you can do it in 1.

FinchDon

Maybe SetCoins and GetCoins i will make it
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

KAKAN

LOL! 1st check the database that you have created the table or not, then check what Thijn, Doom_Killer etc have posted, If u can't understand, then this link may help you:- http://www.learnenglish.de/
oh no

FinchDon

Thanks Problem Solve I make SetCoins and GetCoins and its Work Anyway Thanks all
For any help and support Join #s-s at IRC for Help in Scripting
( For Newbies )

Thijn

If those functions are doing a query each you might wanna reconsider doing it the easy way...