26.06.2011, 01:49
The variable connected to the ID of the car is BombCars. You are checking if another variable BombCar has the vehicle id which it won't work.
I'll restructure your script a bit for you.
I'll restructure your script a bit for you.
pawn Код:
#include <a_samp>
#define MAX_BOMB_VEHICLES 100 //Change this to how many the max is.
enum V_INFO
{
model,
Float:xPos, Float:yPos, Float:zPos, Float:anglePos,
vehid
};
new bombvehicles[MAX_BOMB_VEHICLES][V_INFO];
new bombidv=0;
public OnGameModeInit()
{
CreateBombVehicle(....);
return 1;
}
stock CreateBombVehicle(modelid, Float:xpos, Float:ypos, Float:zpos, Float:angle)
{
bombvehicles[bombidv][model] = modelid;
bombvehicles[bombidv][xPos] = xpos;
bombvehicles[bombidv][yPos] = ypos;
bombvehicles[bombidv][zPos] = zpos;
bombvehicles[bombidv][anglePos] = angle;
bombvehicles[bombidv][vehid] = AddStaticVehicle(bombvehicles[bombidv][model], bombvehicles[bombidv][xPos], bombvehicles[bombidv][yPos], bombvehicles[bombidv][zPos]+1, bombvehicles[bombidv][anglePos], random(15), random(15));
bombidv++;
return 1;
}
public OnVehicleDeath(vehicleid)
{
for(new i; i<MAX_BOMB_VEHICLES; i++)
{
if(bombvehicles[i][model] == 0) break;
if(bombvehicles[i][vehid] == vehicleid)
{
SetVehicleToRespawn(vehicleid);
break;
}
}
return 1;
}