Posts: 617
Threads: 129
Joined: Feb 2014
How can i add offline scores, example i have 10 score and then i use my command in game and try's to add 5 more score to the account, how can i do that while the player is offline?..
PHP Code:
new INI:ACCOUNT = INI_Open(file);
INI_SetTag(ACCOUNT,"data");
INI_WriteInt(ACCOUNT, "Score", "What would i add here? to add the score");
INI_Close(ACCOUNT);
If you have the user files in scriptfiles folder you can edit his stats out.Hope this helps.
Posts: 1,506
Threads: 13
Joined: Jun 2015
It's pretty simple, I wonder what you're thinking in your mind on how to do it... Mind telling us?
Posts: 617
Threads: 129
Joined: Feb 2014
Quote:
Originally Posted by Logic_
It's pretty simple, I wonder what you're thinking in your mind on how to do it... Mind telling us?
|
The only idea i can think of is getplayerscore, but how can i get a player score if he/she is offline so that surely wont work
Posts: 126
Threads: 28
Joined: Jun 2015
Reputation:
0
I think you should do that in MySQL
Posts: 617
Threads: 129
Joined: Feb 2014
Quote:
Originally Posted by Abagail
I'm against using outdated INI methods when there are things like MySQL or SQLite. If you're bound to using this, you should simply get their stored score and add on to it. Example where newscore is the amount of score you want to add on (or subtract by having it a negative value).
pawn Code:
INI_WriteInt(ACCOUNT, INI_Int(ACCOUNT, "Score") + newscore);
|
I dont know where i went wrong but that coding crashes my pawno, also im just starting to learn about MySQL and SQLite...
PHP Code:
INI_WriteInt(ACCOUNT, INI_Int(ACCOUNT, "Score") + amount);
I think this is why the pawno crashes
PHP Code:
INI_WriteInt(ACCOUNT, INI_Int(ACCOUNT,