help me pls
#1

Hello,
I want to make a race that longer is then my normal race time.
now i have made something like this but it gives some errors.


new rNameFile [128];
format(rNameFile, sizeof(rNameFile), "/rRaceSystem/RaceNames/RaceNames.txt");
format(string, sizeof(string), "Race_%d", dini_Get(rNameFile, string));
if "Race_%d", == "Race_5";
Position = 0;
FinishCount = 0;
JoinCount = 0;
Loop(x, 2) PlayersCount[x] = 0;
Joined[playerid] = true;
CountAmount = COUNT_DOWN_TILL_RACE_START;
RaceTime = MAX_RACE_TIME_LONG;
RaceBusy = 0x01;
TimeProgress = 0;
SetupRaceForPlayer(playerid);
CountTimer = SetTimer("CountTillRace", 999, 1);
else
Position = 0;
FinishCount = 0;
JoinCount = 0;
Loop(x, 2) PlayersCount[x] = 0;
Joined[playerid] = true;
CountAmount = COUNT_DOWN_TILL_RACE_START;
RaceTime = MAX_RACE_TIME;
RaceBusy = 0x01;
TimeProgress = 0;
SetupRaceForPlayer(playerid);
CountTimer = SetTimer("CountTillRace", 999, 1);

return 1;
}

this are the errors

C:\Program Files\Rockstar Games\gamemodes\gmd.pwn(1684) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\gamemodes\gmd.pwn(1684) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\gamemodes\gmd.pwn(1696) : error 029: invalid expression, assumed zero

row 1684:
if "Race_%d", == "Race_5";


i tried to:
if string, "Race_%d", == "Race_5";
but it gives the same errors

Can someone help me pls?

the red text is the error row! row 1684 and 1696
Reply
#2

pawn Код:
if(string == "Race_5") //UPDATED
if "Race_%d", == "Race_5"; //OLD
Reply
#3

pawn Код:
new rNameFile [128];
format(rNameFile, sizeof(rNameFile), "/rRaceSystem/RaceNames/RaceNames.txt");
format(string, sizeof(string), "Race_%d", dini_Get(rNameFile, string));
if(string == "Race_5")
{
Position = 0;
FinishCount = 0;
JoinCount = 0;
Loop(x, 2) PlayersCount[x] = 0;
Joined[playerid] = true;
CountAmount = COUNT_DOWN_TILL_RACE_START;
RaceTime = MAX_RACE_TIME_LONG;
RaceBusy = 0x01;
TimeProgress = 0;
SetupRaceForPlayer(playerid);
CountTimer = SetTimer("CountTillRace", 999, 1);
}
else
{
Position = 0;
FinishCount = 0;
JoinCount = 0;
Loop(x, 2) PlayersCount[x] = 0;
Joined[playerid] = true;
CountAmount = COUNT_DOWN_TILL_RACE_START;
RaceTime = MAX_RACE_TIME;
RaceBusy = 0x01;
TimeProgress = 0;
SetupRaceForPlayer(playerid);
CountTimer = SetTimer("CountTillRace", 999, 1);
}
return 1;
}
Reply
#4

now i got 1 error
C:\Program Files\Rockstar Games\gamemodes\gmd.pwn(1684) : error 033: array must be indexed (variable "string")

if i make a new string [128] he said:
C:\Program Files\Rockstar Games\gamemodes\gmd.pwn(1682) : error 021: symbol already defined: "string"

can you help me with that pls?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)