#1

I want a FS which will give Score every 3-4 minutes ...
Reply
#2

Use SetTimer for this.

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#3

Can you do it ?
Reply
#4

You don't have to download a filterscript you can create that by scripting 1 minute!
pawn Код:
public OnGameModeInit()
{
    SetTimer("Score", 180000,true);//1800000 = 3 minutes , true means the timer will repeat!
    return 1;
}
forward Score();//here we are calling the callback of the timer !
public Score()//when the timer pass
{
    for(new i = 0; i < MAX_PLAYERS; i++)//loop through all players are connected
    {
        if(!IsPlayerConnected(i)) continue;//check the connect players
        SetPlayerScore(i,GetPlayerScore(playerid)+1);//that line will set score for all players +1 you can change that!
    }
}
Source :
https://sampwiki.blast.hk/wiki/SetTimer
https://sampwiki.blast.hk/wiki/Loops
https://sampwiki.blast.hk/wiki/GetPlayerScore
https://sampwiki.blast.hk/wiki/SetPlayerScore
Reply
#5

See i also tried making it
Код:
#include <a_samp>

new ScoreFunc[MAX_PLAYERS];
forward ScoreTimer[playerid];

public OnPlayerConnect(playerid)
{
    ScoreFunc[playerid] = SetTimer("ScoreTimer",2,1);
    return 1;
}

public ScoreTimer(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) +6);
    KillTimer(ScoreFuc[playerid]);
    ScoreFunc[playerid] = SetTimer("ScoreTimer",2,1);
    return 1;
}
But i got these errors
D:\$ercret\extreme fun world\filterscripts\score.pwn(5) : error 001: expected token: "(", but found "["
D:\$ercret\extreme fun world\filterscripts\score.pwn(5) : error 001: expected token: ";", but found "-identifier-"
(13) : error 025: function heading differs from prototype
(16) : error 017: undefined symbol "ScoreFuc"
(16) : warning 215: expression has no effect
(16) : error 001: expected token: ";", but found "]"
(16) : error 029: invalid expression, assumed zero
(16) : fatal error 107: too many error messages on one line


EDIT: Silent Soul your 1 Minute made FS is giving me this error
(14) : error 017: undefined symbol "playerid"
And yea i added #include <a_samp>

EDIT: REPLY PLEASE
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)