Server Side scores?
#1

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


Reply
#2

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
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)