Score system. - 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)
+--- Thread: Score system. (
/showthread.php?tid=645445)
Score system. -
Krauser366 - 26.11.2017
I need help, with the score system, I want that the score from all players keep save (if they're registered, of course), if anyone have the font code for the SATDM v9, it will help me a lot.
Also, I'm looking for the font code that makes the server gives score to the users each momment. And in the chat appears the message, something like: "[Event] Server give you 10 score for event."
I hope you can help me.
Re: Score system. -
rfr - 27.11.2017
You would need to set up <YSI\y_ini>
PHP код:
INI_Int("Score",pInfo[playerid][Score])
public OnPlayerDisconnect
PHP код:
INI_WriteInt(file,"Score",GetPlayerScore(playerid));
This code will not work by copy and pasting it, I don't have time right now to make a tutorial. But just search 'y_ini saving system'.
For the score reward just add a timer
PHP код:
pInfo[playerid][Score]+10; //need y_ini setup
But then again look at tutorials.
Re: Score system. -
Adain - 27.11.2017
Also you can use Dini
You need to include includes, and have basic register system
PHP код:
enum pInfo
{
pScore
}
new PlayerInfo[ MAX_PLAYERS ][ pInfo ];
Add stock
PHP код:
stock GetName(playerid)
{
new name[ MAX_PLAYER_NAME+1 ];
GetPlayerName(playerid, name, sizeof( name ));
return name;
}
in public OnPlayerSpawn(playerid)
PHP код:
new str[ 256+1 ];
format( str, sizeof( str ), "%s.ini", GetName(playerid));
SetPlayerScore(playerid, dini_Int( file, "Score");
in public OnPlayerDisconnect(playerid)
PHP код:
dini_IntSet( file, "Score", PlayerInfo[ playerid ][ pScore ]);
in public OnPlayerDeath
PHP код:
PlayerInfo[ killerid ][ pScore ] ++;