score per minute (0.3c)
#1

is there anyone who can help me figure out how to add so people get 1 score each minute they are ingame?
i've searched around but i didn't find anything.. and i've tried to fix it myself but i don't manage to figure it out..
is there anyone who can make it and tell how to add it to gamemods? im trying to make a stunt server and want so people can earn score each minute.

PS: is there any way to save the stats after they gotten it also like.. before server restarts and shutdown of it?
Reply
#2

Well I've got a system similar to that, so it'd be like this:

pawn Код:
forward Online();
public Online()
{
    foreach (Player, i)
    {
        PlayerInfo[i][pScore] += 1;
        new newscore = PlayerInfo[i][pScore]
        SetPlayerScore(i, newscore);
    }
    return 1;
}
(Get the foreach include) ^

OnGameModeInit:
pawn Код:
SetTimer("Online",60000,1);
Not sure if 1 minute is 60000 or not.
Reply
#3

You could just do
pawn Код:
forward Online();
public Online()
{
    for(new i = 0;i != MAX_PLAYERS;++i)
    {
        SetPlayerScore(i, GetPlayerScore(i)+1);
    }
    return 1;
}
Reply
#4

i got a freeroam/stunt/dm gamemod at my server and trying to fix it.. but where do i add it? i don't realy understand that

does it save after server shutdown?
Reply
#5

pawn Код:
SetTimer("Online",60000,1);
^
This one goes under OnGameModeInit

pawn Код:
forward Online();
public Online()
{
    for(new i = 0;i != MAX_PLAYERS;++i)
    {
        SetPlayerScore(i, GetPlayerScore(i)+1);
    }
    return 1;
}
^
This one goes wherever you want (out of any callback)!
Reply
#6

there is only one problem.. i can't find any OnGameModeInit at my gamemode. is there at any filter i shall put it or do i just make that line myself?
Reply
#7

when u started a new pawn in the beginning when u started ur GM, you could choose either to pick a FS or GM by deliting the OnGameModeInit or OnFilterScriptInit

since you don't have OnGameModeInit, you should put it there, or you might try to change OnFilterscriptinit and OnFilterscriptExit into OnGameModeInit or OnGameModeExit... but I do not know if it would work for you
Reply
#8

https://sampforum.blast.hk/showthread.php?tid=21250

im using his gamemode. sorry if its advertise or something.. im trying to learn pawno but its not easy so i kind of having problems..
Reply
#9

That gamemode is VERY old. If you want to learn pawn by looking at others' work, better choose another gamemode, that is not made at the time of 0.2x, as nowadays SA-MP has many other new functions.
Reply
#10

ah... so thats why i got so much problems with my server these days.. i just want to learn some simple pawno things if not i coud need a scripter. but i see that i kind of failed at this.. if what you're saying is correct then i'll have to search for a while again.. thx for all the answers atleast
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)