18.01.2012, 22:05
Hey,
I was trying to make a command as such so I can determine the seat number of each vehicle and then working out weather there is a free seat. Heres the car seat max
And heres my stock.
I get these errors when I compile it.
Can anyone help me solve these, Thanks.
I was trying to make a command as such so I can determine the seat number of each vehicle and then working out weather there is a free seat. Heres the car seat max
pawn Код:
new VehicleSeats[] =
{
4,2,2,2,4,4,1,2,2,4,2,2,2,4,2,2,4,2,4,2,4,4,2,2,2,1,4,4,4,2,1,500,1,2,2,0,2,500,4,2,4,1,2,2,2,4,1,2,
1,0,0,2,1,1,1,2,2,2,4,4,2,2,2,2,1,1,4,4,2,2,4,2,1,1,2,2,1,2,2,4,2,1,4,3,1,1,1,4,2,2,4,2,4,1,2,2,2,4,
4,2,2,1,2,2,2,2,2,4,2,1,1,2,1,1,2,2,4,2,2,1,1,2,2,2,2,2,2,2,2,4,1,1,1,2,2,2,2,500,500,1,4,2,2,2,2,2,
4,4,2,2,4,4,2,1,2,2,2,2,2,2,4,4,2,2,1,2,4,4,1,0,0,1,1,2,1,2,2,1,2,4,4,2,4,1,0,4,2,2,2,2,0,0,500,2,2,
1,4,4,4,2,2,2,2,2,4,2,0,0,0,4,0,0
};
And heres my stock.
pawn Код:
stock GetEmptySeat(vehicleid)
{
new bool:taken[4], Model = GetVehicleModel(vehicleid);
foreach(Player, i)
{
if(IsPlayerInVehicle(i, vehicleid))
{
for(new j = 0; j < sizeof(VehicleSeats[Model - 400]); j++) //error line
{
if(GetPlayerVehicleSeat(i) == j) Taken[j] = true;
}
for(new k = 0; k < sizeof(Taken); k++)
{
if(Taken[k] == false) return 0;
}
}
}
return 1;
}
pawn Код:
(143) : error 080: unknown symbol, or not a constant symbol (symbol "Model")
(143) : error 036: empty statement
(143) : error 017: undefined symbol "j"
(143) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.