SA-MP Forums Archive
Score saving - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Score saving (/showthread.php?tid=237368)



Score saving - chrifokun - 09.03.2011

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.


Re: Score saving - Stigg - 09.03.2011

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


Re: Score saving - Johnson_boy - 09.03.2011

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.


AW: Score saving - chrifokun - 09.03.2011

@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?


Re: Score saving - int3s0 - 09.03.2011

You can save it without MySQL.

Just say what saving system are you using?


Re: Score saving - sim_sima - 09.03.2011

You can use dini in stead of MySQL


AW: Score saving - chrifokun - 09.03.2011

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


Re: Score saving - ilikenuts - 09.03.2011

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


Re: Score saving - Mean - 09.03.2011

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" );
}



AW: Score saving - chrifokun - 09.03.2011

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