how to save 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: how to save scores (
/showthread.php?tid=262386)
how to save scores -
Iphone1234g - 17.06.2011
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=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerScore(i, GetPlayerScore(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
Re: how to save scores -
jamesbond007 - 17.06.2011
u can use dini to save it to a file and then load it when u join the server
Re: how to save scores -
[GTA]AmericanGangster - 17.06.2011
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!
Re: how to save scores -
Benjo - 17.06.2011
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!
Re: how to save scores -
Iphone1234g - 18.06.2011
i just edit the luxadmin and change kills to scores and done thanks for suggestions KISS U ALL!