SA-MP Forums Archive
Score problem - 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: Score problem (/showthread.php?tid=270936)



Score problem - tbedy - 22.07.2011

please can you tell me how to make that 1 minute on server give players to 1 score and that scores save when some goes disconnect and come back that score is same...


Re: Score problem - iPLEOMAX - 22.07.2011

Simple Method:
pawn Код:
//On Top of your script
new OneScoreTimer;

//In OnGameModeInit
OneScoreTimer = SetTimerEx( "GiveAllScore", 1000*60, true, "i", 1 );

//In OnGameModeExit or whenever you want to stop this timer:
KillTimer(OneScoreTimer);

//At the end of your script:
forward GiveAllScore( score );
public GiveAllScore( score )
{
    for ( new i=0; i<MAX_PLAYERS; i++ )
    {
        if ( IsPlayerConnected(i) ) { SetPlayerScore( i, GetPlayerScore(i) + score ); }
    }
}
And for Register/Login system, you can take a look at the scripting tutorials section.
GL.


Re: Score problem - tbedy - 22.07.2011

what for reg/log system? i using Lu Admin


Re: Score problem - iPLEOMAX - 22.07.2011

Alright then, you don't need the Reg/Log system.

But the code I gave you above should give 1 score to each player per minute.


Re: Score problem - MadeMan - 22.07.2011

I think there is score saving in LuxAdmin, you just need to enable it.


Re: Score problem - tbedy - 22.07.2011

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Alright then, you don't need the Reg/Log system.

But the code I gave you above should give 1 score to each player per minute.
i ok... this is almost same thing..

thank you, but will save all scores if player goes offline?


Re: Score problem - iPLEOMAX - 22.07.2011

I found this in LuxAdmin Topic:

Quote:
+ Save Player Statistics (Deaths+Kills+Weapons+Money+Position+TimeInServer+ Ip+Health+Armour+Score+WantedLevel)
So, Yeah it should save.