Help score timer dont save - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help score timer dont save (
/showthread.php?tid=246903)
Help score timer dont save -
Matheo - 06.04.2011
Hi,
I make a SetTimer for my gamemod but dont save this.
Код:
forward Score (playerid);
SetTimer ("Score", 60000, true);
Score public (playerid)
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if ( IsPlayerConnected ( i ) )
{
new Current;
Current = GetPlayerScore(i);
SetPlayerScore(i,Current + 1);
}
Re: Help score timer dont save -
Biesmen - 06.04.2011
I don't really understand what you're trying. Your script completely fails. First of all, try this:
pawn Код:
forward Score(playerid);
SetTimerEx("Score", 60000, true, "i", playerid); // Score is based on a player id, so use SetTimerEx
public Score(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid) + 1);
return 1;
}
And why would you make a loop at Score? It's already for playerids.
And you don't have to check if the player is connected, because it will only set a timer on the player who is connected.
Re: Help score timer dont save -
Matheo - 06.04.2011
i try this, and is great. really thanks .
but i have an another question. (sorry for my bad english.)
look that screen please.
/imageshack/i/omgx.jpg/
Re: Help score timer dont save -
Biesmen - 06.04.2011
Well, try to translate for me what it says, and post the code.
Re: Help score timer dont save -
Matheo - 06.04.2011
i dont have this code. maybe i need to make it in my GM.
But in my screen : "Prochain niveau" : 1714/2160 is the time left for the next level. (One level = 1score)
Re: Help score timer dont save -
Biesmen - 06.04.2011
Well, I can't fix anything if I don't have a code.
Re: Help score timer dont save -
Matheo - 06.04.2011
thanks for the first help.
Re: Help score timer dont save -
[M.A]Angel[M.A] - 07.04.2011
Maybe this will work.
Код:
forward Score (playerid);
SetTimer ("Score",10*60000, true);
Score public (playerid)
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if ( IsPlayerConnected ( i ) )
{
new Current;
Current = GetPlayerScore(i);
SetPlayerScore(i,Current + 1);
}
else
Код:
public OnPlayerConnect(playerid)
{
SetTimerEx("GiveScore", 60*1000, true, "i", playerid);
return 1;
}
forward GiveScore(playerid);
public GiveScore(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
}
Re: Help score timer dont save -
Matheo - 11.04.2011
Angel, your post is for my screenshot ?