enum CARS_DATA
{
MODELID,
Float:X,
Float:Y,
Float:Z,
Float:A,
C1,
C2
};
new CopCars[][CARS_DATA] =
{
{523,-215.9483,984.5226,18.9468,271.7301,0,0},
{523,-215.9859,987.1728,19.0048,270.5827,0,0},
{598,-228.1274,991.1447,19.2631,269.0867,0,1},
{599,-228.6810,996.4469,19.7480,268.6263,0,1},
{598,-214.6644,973.0877,19.0327,271.4312,0,1}
};
for(new a=0; a< sizeof CopCars; a++)
{
CreateVehicle
(
CopCars[a][MODELID],
CopCars[a][X],
CopCars[a][Y],
CopCars[a][Z],
CopCars[a][A],
CopCars[a][C1],
CopCars[a][C2],
1000
);
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new CarID = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER) {
if(CarID == CopCars) {
if(pInfo[playerid][Darbas] == 1) {
} else {
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
C:\Documents and Settings\Simas\Desktop\RL\gamemodes\RL0.1.pwn(206) : error 033: array must be indexed (variable "CopCars")
if(CarID == CopCars) {
for(new c; c < sizeof(CopCars); c++) if(CarID == CopCars[copcarloop]) {
|
Originally Posted by //exora
pawn Код:
|
Vecid
CopCars[a][Vecid] = CreateVehicle//bla bla.
new
bool:samevec;
for(new i,j=sizeof CopCars;i < j;i++){
if(CopCars[i][Vecid] == playervecid){
samevec = true;
break;
}
}
//then bla
stock IsListedCar(vehicleid)
{
for(new i,j=sizeof(CopCars); i<j; i++)
{
if(CopCars[i][Vecid] == vehicleid) return 1;
}
return 0;
}