SA-MP Forums Archive
Help - 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)
+--- Thread: Help (/showthread.php?tid=481559)



Help - Hammad97 - 16.12.2013

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


Re: Help - arakuta - 16.12.2013

Use SetTimer for this.

https://sampwiki.blast.hk/wiki/SetTimer


Re: Help - Hammad97 - 16.12.2013

Can you do it ?


Re: Help - SilentSoul - 16.12.2013

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


Re: Help - Hammad97 - 17.12.2013

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