Score Goes Up By Minute
#1

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
Reply
#2

Код:
forward Score(playerid);

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

AddTimer("Score",60000,true);
Reply
#3

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?
Reply
#4

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
Reply
#5

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?

Reply
#6

I have an error

error 022: must be lvalue (non-constant)
Reply
#7

Quote:
Originally Posted by Ownzer
I have an error

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

yes it is
Reply
#9

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

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"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)