Score point - 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 point (
/showthread.php?tid=447735)
Score point -
KimSangBum - 01.07.2013
Hello I want add to my server score timer
Each 10 minute = 1 point score , How I can do that ?
Re: Score point -
Firewire - 01.07.2013
For this to work, you need the foreach include, you can get it here:
https://sampforum.blast.hk/showthread.php?tid=92679
Well first you'd have to make the timer, this goes inside OnGameModeInit():
pawn Код:
SetTimer("Score",1000*60*10, true); // 1ms x 60 x 10 = 10 minutes
Then you'd have to use foreach or a loop in a function to loop through the players and set them +1 score.
pawn Код:
forward Score();
public Score()
{
foreach(Player, i) // Loops through each player - Better than using a standard loop.
{
SetPlayerScore(i, GetPlayerScore(i) + 1); // Setting the player score - Gets the current score and adds one(1)
}
return true;
}