how to save scores
#1

hello alll i am really sad coz no one help me
plz tell me when player enter in cp the i did this

PHP код:
for(new i=0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
SetPlayerScore(iGetPlayerScore(i) + 3);
        }
    } 
and its save scores but when i quit and join agian the scores not saves plz help me how to save scores i also use luxadmin
Reply
#2

u can use dini to save it to a file and then load it when u join the server
Reply
#3

Quote:
Originally Posted by philmckrakin
Посмотреть сообщение
hello supposing your using dudb to save player data u can do this
Код:
// ok so inside OnPlayerDisconnect do this

if (PInfo[playerid][LoggedIn] == 1)
{
   	// Was loggedin, so save the data!

  	dUserSetINT(PlayerName(playerid)).("Score",GetPlayerScore(playerid));// score save is here
}

// now inside your login command / auto login, do this

SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("Score"));// this sets their score to the saved amount
im pretty sure as long as you base your player saving on dudb then this will work (it does for me anyway)


This is from a player i found it here!
Reply
#4

You need to write the code to tell it where and how to save the information. If you are new to this, then you might want to have a look into saving the information into a text file. There's a tutorial about this on the Wiki, which you can find here: https://sampwiki.blast.hk/wiki/File_Functions

Hope that helps!
Reply
#5

i just edit the luxadmin and change kills to scores and done thanks for suggestions KISS U ALL!
Reply


Forum Jump:


Users browsing this thread: