This code give me these errors - 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: This code give me these errors (
/showthread.php?tid=268254)
This code give me these errors -
BartDashio - 11.07.2011
Код:
C:\Users\Aaron\Desktop\WASTED-RP\gamemodes\Wasted.pwn(9032) : error 028: invalid subscript (not an array or too many subscripts): "playercarid"
C:\Users\Aaron\Desktop\WASTED-RP\gamemodes\Wasted.pwn(9032) : warning 215: expression has no effect
C:\Users\Aaron\Desktop\WASTED-RP\gamemodes\Wasted.pwn(9032) : error 001: expected token: ";", but found "]"
C:\Users\Aaron\Desktop\WASTED-RP\gamemodes\Wasted.pwn(9032) : error 029: invalid expression, assumed zero
C:\Users\Aaron\Desktop\WASTED-RP\gamemodes\Wasted.pwn(9032) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
public LoadHouseCars(playerid)
{
new Float:Carx = PlayerInfo[playerid][pHouseCarX];
new Float:Cary = PlayerInfo[playerid][pHouseCarY];
new Float:Carz = PlayerInfo[playerid][pHouseCarZ];
new Float:Carangle = PlayerInfo[playerid][pHouseCarAngle];
new CarId = PlayerInfo[playerid][pHouseCarId];
if(PlayerInfo[playerid][pHouseCarColorChosen] == 0) // Random color
{
new randcolor = 1 + random(125);
playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,randcolor,randcolor,10000);
}
else if(PlayerInfo[playerid][pHouseCarColorChosen] == 1) // bought colors
{
new color1 = PlayerInfo[playerid][pHouseCarColor1];
new color2 = PlayerInfo[playerid][pHouseCarColor2];
playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,color1,color2,10000);
}
for (new i=0; i<MAX_POINTS; i++)
{
new cartolock = playercarid[playerid];
SetVehicleParamsForPlayer(cartolock,i,0,0);
PlayerInfo[playerid][pHouseCarLocked] = 0; // unlocked
}
return 1;
}
Re: This code give me these errors -
PotH3Ad - 11.07.2011
Seems like "playercarid" is currently a variable. It needs to be an array.
Change:
to
pawn Код:
new playercarid[MAX_PLAYERS];