Simple 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: Simple score system. (
/showthread.php?tid=289599)
Simple score system. -
Azzeto - 12.10.2011
I need help to create a [probably] simple score system. I'm a newb with timers but I need an example of each
1. Everyhour some one gets 1 score.
2. Some one does an action and gets 1 score [Ex. Robbing a store]
Whoever helps will recieve a rep.
Re: Simple score system. -
Wesley221 - 12.10.2011
pawn Код:
SetTimer("ScoreTimer", 3600000, true); // add this to OnGameModeInit, this will repeat every 1 hour (3600000 miliseconds in 1 hour (if im right))
// it will create a timer with name 'ScoreTimer'
forward ScoreTimer(); // forwarding the timer with name 'ScoreTimer'
public ScoreTimer() // the public of the timer, it will do this every hour
{
foreach(Player, i) // need the foreach include
{
SetPlayerScore(i, GetPlayerScore(i) + 1)
}
return 0;
}
This would help you with the timer thing
Re: Simple score system. -
Azzeto - 12.10.2011
Posting this before I tested it, but i'm repping you for helping, just one question, does this restart the timer when a player logs in? Or lets say a player logs in for like 21 minutes, logs out, and logs back in like 10 minutes later, does the timer reset, or continue from where he logged out?
-Didnt have the foreach, added it now, now I get 1 error
Fixed it