SA-MP Forums Archive
Race Script 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Race Script Help (/showthread.php?tid=135443)



Race Script Help - [MWR]Blood - 20.03.2010

FIXED!


Re: Race Script Help - [MWR]Blood - 21.03.2010

Bump!


Re: Race Script Help - jameskmonger - 21.03.2010

pawn Код:
if(RacePos[playerid] == 1)
    {
        GivePlayerMoney(playerid,10000);
    }
return 1;
}



Re: Race Script Help - [MWR]Blood - 21.03.2010

Quote:
Originally Posted by jameskmonger
pawn Код:
if(RacePos[playerid] == 1)
    {
        GivePlayerMoney(playerid,10000);
    }
return 1;
}
No... again the same


Re: Race Script Help - Kyosaur - 21.03.2010

Quote:
Originally Posted by ikarus
Quote:
Originally Posted by jameskmonger
pawn Код:
if(RacePos[playerid] == 1)
    {
        GivePlayerMoney(playerid,10000);
    }
return 1;
}
No... again the same
This is going to sound harsh, but you shouldnt worry about a race script if you cant find/fix that error.

It means, RacePos is declared as a varaible, not an array (which you are using it as).


Re: Race Script Help - Rac3r - 21.03.2010

Kyosaur!! means :
Код:
new RacePos;
Needs to be :
Код:
new RacePos[MAX_PLAYERS];



Re: Race Script Help - [MWR]Blood - 21.03.2010

Quote:
Originally Posted by Rac3r
Kyosaur!! means :
Код:
new RacePos;
Needs to be :
Код:
new RacePos[MAX_PLAYERS];
yes but if I put [MAX_PLAYERS] after RacePos, I get this:
Код:
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : error 022: must be lvalue (non-constant)
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : warning 215: expression has no effect
F:\Street Racers And Drifters\filterscripts\Race.pwn(439) : error 033: array must be indexed (variable "RacePos")
Line 314:
pawn Код:
RacePos ++;
Line 439:
pawn Код:
RacePos = 0;



Re: Race Script Help - Kyosaur - 21.03.2010

Quote:
Originally Posted by ikarus
Quote:
Originally Posted by Rac3r
Kyosaur!! means :
Код:
new RacePos;
Needs to be :
Код:
new RacePos[MAX_PLAYERS];
yes but if I put [MAX_PLAYERS] after RacePos, I get this:
Код:
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : error 022: must be lvalue (non-constant)
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : warning 215: expression has no effect
F:\Street Racers And Drifters\filterscripts\Race.pwn(439) : error 033: array must be indexed (variable "RacePos")
Line 314:
pawn Код:
RacePos ++;
Line 439:
pawn Код:
RacePos = 0;
You are way to inexperienced to be trying to code a race script mate (not trying to be a dick).

314 - RacePos[playerid]++;
439 - RacePos[playerid] = 0;

If playerid isnt available, you're going to have to make a for/loop to go through all the player ids.


Re: Race Script Help - [MWR]Blood - 21.03.2010

Quote:
Originally Posted by Kyosaur!!
Quote:
Originally Posted by ikarus
Quote:
Originally Posted by Rac3r
Kyosaur!! means :
Код:
new RacePos;
Needs to be :
Код:
new RacePos[MAX_PLAYERS];
yes but if I put [MAX_PLAYERS] after RacePos, I get this:
Код:
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : error 022: must be lvalue (non-constant)
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : warning 215: expression has no effect
F:\Street Racers And Drifters\filterscripts\Race.pwn(439) : error 033: array must be indexed (variable "RacePos")
Line 314:
pawn Код:
RacePos ++;
Line 439:
pawn Код:
RacePos = 0;
You are way to inexperienced to be trying to code a race script mate (not trying to be a dick).

314 - RacePos[playerid]++;
439 - RacePos[playerid] = 0;

If playerid isnt available, you're going to have to make a for/loop to go through all the player ids.
Nice, but when I finish a race it says me: Position: 0 and it doesn't give me any money.


Re: Race Script Help - Kyosaur - 21.03.2010

Quote:
Originally Posted by ikarus
Quote:
Originally Posted by Kyosaur!!
Quote:
Originally Posted by ikarus
Quote:
Originally Posted by Rac3r
Kyosaur!! means :
Код:
new RacePos;
Needs to be :
Код:
new RacePos[MAX_PLAYERS];
yes but if I put [MAX_PLAYERS] after RacePos, I get this:
Код:
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : error 022: must be lvalue (non-constant)
F:\Street Racers And Drifters\filterscripts\Race.pwn(314) : warning 215: expression has no effect
F:\Street Racers And Drifters\filterscripts\Race.pwn(439) : error 033: array must be indexed (variable "RacePos")
Line 314:
pawn Код:
RacePos ++;
Line 439:
pawn Код:
RacePos = 0;
You are way to inexperienced to be trying to code a race script mate (not trying to be a dick).

314 - RacePos[playerid]++;
439 - RacePos[playerid] = 0;

If playerid isnt available, you're going to have to make a for/loop to go through all the player ids.
Nice, but when I finish a race it says me: Position: 0 and it doesn't give me any money.
This is why i said your to inexperienced lol, the questions arent going to stop coming in lol (this is my last answer... i'm down to help, but this script is going to require way to much helping lol... at the end, its going to be like I built it -.-).

If it says zero, your clearing the variable to soon ? i dont have enough code to tell you why its messing up, im just taking a guess.