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)
+--- Thread: Score Problem (
/showthread.php?tid=291575)
Score Problem -
Kostas' - 20.10.2011
I have problem with the score. I want every minute = 1 score.
I have this on OnGameModeInit
pawn Код:
SetTimer("Online",60000,1);
And this
pawn Код:
forward Online();
public Online()
{
for(new i = 0;i != MAX_PLAYERS;++i)
{
SetPlayerScore(i, GetPlayerScore(i)+1);
}
return 1;
}
I have test it on localhost:7777 and works fine, 1 minute = 1 score.
Then I upload it on the server but it doesn't work. The score doesn't update every minute.
What I have wrong with this?
Re: Score Problem -
=WoR=Varth - 20.10.2011
Debug it:
pawn Код:
public Online()
{
for(new i = 0;i != MAX_PLAYERS;++i)
{
SetPlayerScore(i, GetPlayerScore(i)+1);
print("Called");
}
return 1;
}
Re: Score Problem -
Kostas' - 20.10.2011
I kept the
pawn Код:
SetTimer("Online",60000,1);
And I replace this
pawn Код:
forward Online();
public Online()
{
for(new i = 0;i != MAX_PLAYERS;++i)
{
SetPlayerScore(i, GetPlayerScore(i)+1);
}
return 1;
}
To
pawn Код:
public Online()
{
for(new i = 0;i != MAX_PLAYERS;++i)
{
SetPlayerScore(i, GetPlayerScore(i)+1);
print("Called");
}
return 1;
}
But I got a warning
pawn Код:
C:\Documents and Settings\orion\Фб ЭггсбцЬ мпх\Downloads\samp03csvr_R2-2_win32 (2)\gamemodes\Xtreamgaming.pwn(6650) : warning 235: public function lacks forward declaration (symbol "Online")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
Should I add
Re: Score Problem -
=WoR=Varth - 20.10.2011
Re: Score Problem -
Kostas' - 20.10.2011
Ok thank you!
Re: Score Problem -
Kostas' - 20.10.2011
Sorry for double post, but again the score bugged. After 20 minutes the first set 1 score
Now I add this =WoR=Varth said and still doesn't set it when i restart the server.
Re: Score Problem -
=WoR=Varth - 20.10.2011
It's just debugging to check if "Online" called.
Use foreach or check whether player connected or not.
Re: Score Problem -
Kostas' - 20.10.2011
Quote:
Originally Posted by =WoR=Varth
It's just debugging to check if "Online" called.
Use foreach or check whether player connected or not.
|
How to debug to check if "Online"
What do you suggest me, or can you give me an example of how the code should looks like.
Re: Score Problem -
nilanjay - 20.10.2011
pawn Код:
SetTimer("Online",60000,1);
I think because you have set 1 as repeatig number so that means it will only repeat one time.(Sorry or bad english. I hope you understand)
Re: Score Problem -
=WoR=Varth - 20.10.2011
Quote:
Originally Posted by nilanjay
pawn Код:
SetTimer("Online",60000,1);
I think because you have set 1 as repeatig number so that means it will only repeat one time.(Sorry or bad english. I hope you understand)
|
"1" mean it will always repeating.
@Kostas': Search "foreach" in FS section.