PDA

View Full Version : Need help with my Score Script


Stefand
13/11/2011, 10:01 AM
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(38) : error 001: expected token: ")", but found ","
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.


can someone fix it :)

// 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;
}

Stigg
13/11/2011, 10:14 AM
Try:
#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;
}

Kostas'
13/11/2011, 10:18 AM
1000 = 1 second
60000 = 1minute

Do you want every second players get score?

Stefand
13/11/2011, 10:27 AM
No Evrey Hour xD they get 1 score but how do i do that?

Stigg
13/11/2011, 10:31 AM
Your welcome. (errors fix)