SA-MP Forums Archive
Need help with my Score Script - 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: Need help with my Score Script (/showthread.php?tid=296838)



Need help with my Score Script - Stefand - 13.11.2011

Hi,

this script gives me the next errors:

C:\Users\Stefan Dorst\Desktop\backup\filterscripts\score.pwn(12) : error 010: invalid function or declaration
C:\Users\Stefan Dorst\Desktop\backup\filterscripts\score.pwn(22) : error 001: expected token: ")", but found ","
C:\Users\Stefan Dorst\Desktop\backup\filterscripts\score.pwn(3 : error 001: expected token: ")", but found ","
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.


can someone fix it

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>

#define FILTERSCRIPT
#define COLOR_BLUE 0x1229FAFF

new ScoreTimer1[MAX_PLAYERS];
new ScoreTimer2[MAX_PLAYERS];

ScoreTimer1[playerid] = SetTimerEx("AddScore1", 1000, true, "i", playerid);
ScoreTimer2[playerid] = SetTimerEx("AddScore2", 5000, true, "i", playerid);

forward AddScore1(playerid);


public AddScore1(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
    new string[200];
    format(string, sizeof(string, "~g~U're now level 1 Congratz");
    GameTextForPlayer(playerid, string, 1000, 0);
    KillTimer(ScoreTimer1[playerid]);
    if(GetPlayerScore(playerid) < 2)
    {
               KillTimer(ScoreTimer1[playerid]);
    }
    return 1;
}

forward AddScore2(playerid);

public AddScore2(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
    new string[200];
    format(string, sizeof(string, "~g~U're now level 2 Congratz");
    GameTextForPlayer(playerid, string, 1000, 0);
    KillTimer(ScoreTimer2[playerid]);
    if(GetPlayerScore(playerid) < 2) // Change the < 2 of the numbers to the number of scoretimers u got
    {
               KillTimer(ScoreTimer2[playerid]);
    }
    return 1;
}



Re: Need help with my Score Script - Stigg - 13.11.2011

Try:
pawn Код:
#include <a_samp>
#define COLOR_BLUE 0x1229FAFF

new ScoreTimer1[MAX_PLAYERS];
new ScoreTimer2[MAX_PLAYERS];

forward AddScore1(playerid);
forward AddScore2(playerid);

public OnPlayerConnect(playerid)
{
    ScoreTimer1[playerid] = SetTimerEx("AddScore1", 1000, true, "i", playerid);
    ScoreTimer2[playerid] = SetTimerEx("AddScore2", 5000, true, "i", playerid);
    return 1;
}

public AddScore1(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
    new string[200];
    format(string, sizeof(string), "~g~U're now level 1 Congratz");
    GameTextForPlayer(playerid, string, 1000, 0);
    KillTimer(ScoreTimer1[playerid]);
    if(GetPlayerScore(playerid) < 2)
    {
        KillTimer(ScoreTimer1[playerid]);
    }
    return 1;
}

public AddScore2(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
    new string[200];
    format(string, sizeof(string), "~g~U're now level 2 Congratz");
    GameTextForPlayer(playerid, string, 1000, 0);
    KillTimer(ScoreTimer2[playerid]);
    if(GetPlayerScore(playerid) < 2) // Change the < 2 of the numbers to the number of scoretimers u got
    {
        KillTimer(ScoreTimer2[playerid]);
    }
    return 1;
}



Re: Need help with my Score Script - Kostas' - 13.11.2011

1000 = 1 second
60000 = 1minute

Do you want every second players get score?


Re: Need help with my Score Script - Stefand - 13.11.2011

No Evrey Hour xD they get 1 score but how do i do that?


Re: Need help with my Score Script - Stigg - 13.11.2011

Your welcome. (errors fix)