Back the vehicle after death, how?
#1

That what i did -

PHP код:
OnVehicleDeath
if(BombCar[vehicleid] == 1SetVehicleToRespawn(vehicleid);
OnGameModeInit 
for(new ii<sizeof(PlaceCarsBomb);i++)
{
BombCars[i] = AddStaticVehicle(PlaceCarsBombModel[i],PlaceCarsBomb[i][0],PlaceCarsBomb[i][1],PlaceCarsBomb[i][2]+1,PlaceCarsBomb[i][3],random(15),random(15));
BombCar[BombCars[i]] = 1;

The vehicle death but no respawn, why?

Thanks
Reply
#2

Help ?

By the way - the vehicle in virtual world.
Reply
#3

jump
Reply
#4

jump
Reply
#5

OnGameModeInit

Код:
for(new i; i<sizeof(PlaceCarsBomb);i++)
{
BombCars[i] = AddStaticVehicle(PlaceCarsBombModel[i],PlaceCarsBomb[i][0],PlaceCarsBomb[i][1],PlaceCarsBomb[i][2]+1,PlaceCarsBomb[i][3],random(15),random(15),SetVehicleToRespawn(i));
BombCar[BombCars[i]] = 1;
}
or
Код:
for(new i = 0; i < MAX_VEHICLES; i++)
{
BombCars[i] = AddStaticVehicle(PlaceCarsBombModel[i],PlaceCarsBomb[i][0],PlaceCarsBomb[i][1],PlaceCarsBomb[i][2]+1,PlaceCarsBomb[i][3],random(15),random(15),SetVehicleToRespawn(i));
BombCar[BombCars[i]] = 1;
}
Reply
#6

No fixed..............

HELP
Reply
#7

Jump..

That what I did in OnVehicleSpawn -

if(Active[bomb] == 1 && BombCar[vehicleid] == 1)
{
dystroyCar[vehicleid] = 0;
VehicleInfo[vehicleid][CarLocked] = 1;
SetVehicleVirtualWorld(vehicleid,5);
}

What wrong ? I need it in virtual world 5
Reply
#8

jump

HELP PLEASE
Reply
#9

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.
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)