SA-MP Forums Archive
Score Goes Up By Minute - 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: Score Goes Up By Minute (/showthread.php?tid=86150)



Score Goes Up By Minute - Ownzer - 12.07.2009

Hello I was wondering how to make a score goes up by minute everytime you play on the server

Example:

I have played 500 Minutes on the server My score would be 500.

Can you do it for every minute the person stays on the server. So Like I played on a server for ten minutes my score would be 10 Minutes! Everytime I rejoin and Leave. My score will be the same


Re: Score Goes Up By Minute - CJ101 - 12.07.2009

Код:
forward Score(playerid);

public Score(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)++);
return 1;
}
under ongamemodeinit:

AddTimer("Score",60000,true);


Re: Score Goes Up By Minute - Ownzer - 12.07.2009

Thanks but for this
Код:
forward Score(playerid);

public Score(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)++);
return 1;
}
Where does this go and Can I make a Filterscript?



Re: Score Goes Up By Minute - happyface - 12.07.2009

something simple like..

pawn Код:
forward UpdateScore();
pawn Код:
public OnGameModeInIt()
{
    SetTimer("UpdateScore",60000,1);
    return 1;
}
pawn Код:
public UpdateScore()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        GetPlayerScore(newscore);
        oldscore = GetPlayerScore(i);
        newscore = oldscore + 1;
        SetPlayerScore(i, newscore);
    }
    return 1;
}
untested


Re: Score Goes Up By Minute - Ownzer - 12.07.2009

Thanks but for this
Код:
forward Score(playerid);

public Score(playerid)
{
SetPlayerScore(playerid,GetPlayerScore(playerid)++);
return 1;
}
Where does this go and Can I make a Filterscript? Or Gamemode?




Re: Score Goes Up By Minute - Ownzer - 12.07.2009

I have an error

error 022: must be lvalue (non-constant)


Re: Score Goes Up By Minute - happyface - 12.07.2009

Quote:
Originally Posted by Ownzer
I have an error

error 022: must be lvalue (non-constant)
what line, im guessing its setplayerscore?


Re: Score Goes Up By Minute - argon - 12.07.2009

yes it is



Re: Score Goes Up By Minute - happyface - 12.07.2009

pawn Код:
public UpdateScore()
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        GetPlayerScore(newscore);
        oldscore = GetPlayerScore(i);
        newscore = oldscore + 1;
        SetPlayerScore(i, newscore);
    }
    return 1;
}



Re: Score Goes Up By Minute - argon - 12.07.2009

C:\Users\Nuno Valente\Desktop\argstunts\zomg.pwn(1217) : error 017: undefined symbol "newscore"
C:\Users\Nuno Valente\Desktop\argstunts\zomg.pwn(121 : error 017: undefined symbol "oldscore"
C:\Users\Nuno Valente\Desktop\argstunts\zomg.pwn(1219) : error 017: undefined symbol "newscore"
C:\Users\Nuno Valente\Desktop\argstunts\zomg.pwn(1219) : error 017: undefined symbol "oldscore"
C:\Users\Nuno Valente\Desktop\argstunts\zomg.pwn(1219) : warning 215: expression has no effect
error 017: undefined symbol "newscore"