Score saving
#1

Hi Guys.

I have a problem with my score-system...
At my server i get +1 Score each PayDay, but when i relogg, my Score is again at 0...
How can i fix it?

Please help me.
Reply
#2

Show us at least a snippet of code, otherwise we cant help you.
Reply
#3

You need to create some saving system.
Maybe dini, maybe MySQL. I suggest MySQL.

Save player's score to username/ip on disconnect, and restore it from database/file on connect.
Reply
#4

@Stigg :

public payday() {
for (new i = 0; i < MAX_PLAYERS; i++) {
SendClientMessage(i,COLOR_BLUE,"Payday! Du erhдltst $10000!");
GivePlayerMoney(i,10000);
SetPlayerScore(i,GetPlayerScore(i)+1);
}
return 1;
}


@Johnson_boy :

I can't save it without MySQL?
Reply
#5

You can save it without MySQL.

Just say what saving system are you using?
Reply
#6

You can use dini in stead of MySQL
Reply
#7

What do you mean with saving system?
I think, i don't use any saving systems...
Reply
#8

Quote:
Originally Posted by sim_sima
Посмотреть сообщение
You can use dini in stead of MySQL
lol Dini is now old,,,, use y_ini or MySQL
Reply
#9

Y_INI example:
pawn Код:
CMD:savemyscore( playerid, params[ ] )
{
    new file[ 128 ], name[ 24 ];
    GetPlayerName( playerid, name, sizeof name );
    format( file, sizeof file, "SomeFolder/%s.ini", name );
    new INI:PlayerAcc = INI_Open( file );
    INI_WriteInt( PlayerAcc, "Score", GetPlayerScore( playerid ) );
    INI_Close( PlayerAcc );
    return SendClientMessage( playerid, 0xAAAAAA, "Your score has been saved to your userfile. FOLDER: scriptfiles/SomeFolder/yourname.ini" );
}
Reply
#10

I downloaded MySQL...
But what to do now?
Someone know good video to describe it?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)