04.10.2009, 22:12
could someone help me make a timer/code that makes all the players score go up every second or every minute go up 1 piont
TY
Nathanael_Tavares
TY
Nathanael_Tavares
forward ScoreTimer(playerid);
SetTimerEx("ScoreTimer",60000,0,"d",playerid);
public ScoreTimer(playerid)
{
SetPlayerScore(playerid,(playerid)+1);
return 1;
}
Originally Posted by 3xPloSioNxXx
Easy
do it like this: On the top of your script,after the includes put: pawn Код:
pawn Код:
pawn Код:
PS:now after every 60 seconds everyone will get +1 point I've tested it,its working |
forward Score(playerid);
SetTimer("Score",60000,true);
public Score(playerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
new Current;
Current = GetPlayerScore(i);
SetPlayerScore(i,Current + 1);
}
}
}
Originally Posted by Enemy_Plus[SA:MP
]
Whoa Whoa Whoa.... dude, instead of making that, which creates many timers for every player. Use a loop: pawn Код:
|
SetTimerEx("ScoreTimer",60000,0,"d",playerid);
SetTimerEx("ScoreTimer",60000,1,"d",playerid);