Setting offline cash
#1

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); 
Reply
#2

If you have the user files in scriptfiles folder you can edit his stats out.Hope this helps.
Reply
#3

It's pretty simple, I wonder what you're thinking in your mind on how to do it... Mind telling us?
Reply
#4

Quote:
Originally Posted by Logic_
View Post
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
Reply
#5

Quote:
Originally Posted by 1fret
View Post
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
GetPlayerScore using INI_Int,,
Reply
#6

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);
Reply
#7

I think you should do that in MySQL
Reply
#8

Quote:
Originally Posted by Abagail
View Post
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(ACCOUNTINI_Int(ACCOUNT"Score") + amount); 
I think this is why the pawno crashes

PHP Code:
 INI_WriteInt(ACCOUNTINI_Int(ACCOUNT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)