score system ?
#1

How i can buil score system evry 15 minutes playng online is 1 score ?
Reply
#2

Set a timer every 15 minutes that will check if the player is connected and then set his score to +1
pretty simple

This forum requires that you wait 4.600 seconds between posts. Please try again in 4.543 seconds.
^^ No thank you..
Reply
#3

I cant found that what i want and i want its automaticly add 1 score on evry 15 minutes !
Reply
#4

First you'll need to make a timer like this
pawn Code:
SetTimer("OnlineTimer",100000,true);
//OnlineTimer is the name of a timer
//100000 is the time = 10 min
//false is if the timer will repeat
//EDIT: put this under your OnPlayerSpawn or OnPlayerConnect callback.
Than public it:
pawn Code:
public OnlineTimer
{
    new score = GetPlayerScore(playerid);
SetPlayerScore(playerid,score+1);
return 1;
//EDIT: Put this at the bottom of your script.
}
Untested. I hope it will work
Reply
#5

use this
pawn Code:
SetTimer("ScoreTimer",900000,true); // 900000 = 15 minutes
and this timer
pawn Code:
public ScoreTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    SetPlayerScore(i,GetPlayerScore(i) + 1);
    }
}
}
this might do the trick
Reply
#6

Yeah it's better to use loops
(and I faild about the time, lol )
Reply
#7

Quote:
Originally Posted by Mike_Peterson
View Post
use this
pawn Code:
SetTimer("ScoreTimer",900000,true); // 900000 = 15 minutes
and this timer
pawn Code:
public ScoreTimer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    SetPlayerScore(i,GetPlayerScore(i) + 1);
    }
}
}
this might do the trick
One error


C:\Documents and Settings\Andero\Desktop\Server\gamemodes\Stunters. pwn(404) : error 021: symbol already defined: "SetTimer"
C:\Documents and Settings\Andero\Desktop\Server\gamemodes\Stunters. pwn(405) : warning 235: public function lacks forward declaration (symbol "ScoreTimer")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

How i can fix it i cant find anthore SetTimer ...
Reply
#8

You always HAVE to forward timers.
Somewhere at the top of your script:

pawn Code:
forward SetTimer(playerid);
With this you should lose that warning 235. at the line 405.

Can you please post your script so we can see where is that error?
Reply
#9

DELETED
//////////
Reply
#10

Lmao, not the full script
Just that part where is error.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)