Need help with my Score Script
#1

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

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;
}
Reply
#3

1000 = 1 second
60000 = 1minute

Do you want every second players get score?
Reply
#4

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

Your welcome. (errors fix)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)