SA-MP Forums Archive
Server Side scores? - 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: Server Side scores? (/showthread.php?tid=145989)



Server Side scores? - Anthony_Brassi - 05.05.2010

Uhh, Excuse me if i mistype something, so tired :/

Yes, this is question that's asked alot, im too tired to answer it myself...


anywho, I know the basics, so if you give me an example, I can Set it up myself, I just need a starting point, I've got no idea how to save scores





Re: Server Side scores? - MWF2 - 05.05.2010

Either use dudb:

http://forum.sa-mp.com/index.php?topic=4798.0


Or use this from southclaw:


Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Here's a save system, you can also use this to save more things to a user file, such as money.
public OnPlayerDisconnect(playerid, reason)
{
new pFile[28], pName[24], score = GetPlayerScore(playerid);
GetPlayerName(playerid, pName, 24);
format(pFile, 28, "PlayerAccounts\%s.txt", pName);
if(!dini_Exists(pFile))dini_Create(pFile);
dini_IntSet(pFile, "score", score);
}
public OnPlayerConnect(playerid, reason)
{
new pName[24], pFile[28], pScore;
GetPlayerName(playerid, pName, 24);
format(pFile, 28, "PlayerAccounts\%s.txt", pName);
SetPlayerScore(playerid, dini_Int(pFile, "score"));
}


If you want to know how to add other things in to it ask me



Re: Server Side scores? - Anthony_Brassi - 05.05.2010

Quote:
Originally Posted by MWF2
Either use dudb:

http://forum.sa-mp.com/index.php?topic=4798.0


Or use this from southclaw:


Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Here's a save system, you can also use this to save more things to a user file, such as money.
public OnPlayerDisconnect(playerid, reason)
{
new pFile[28], pName[24], score = GetPlayerScore(playerid);
GetPlayerName(playerid, pName, 24);
format(pFile, 28, "PlayerAccounts\%s.txt", pName);
if(!dini_Exists(pFile))dini_Create(pFile);
dini_IntSet(pFile, "score", score);
}
public OnPlayerConnect(playerid, reason)
{
new pName[24], pFile[28], pScore;
GetPlayerName(playerid, pName, 24);
format(pFile, 28, "PlayerAccounts\%s.txt", pName);
SetPlayerScore(playerid, dini_Int(pFile, "score"));
}


If you want to know how to add other things in to it ask me
lol, i did it with my scripts registration system, was so easy, i was too tired to think last night >_< anyways, thanks for the help