SA-MP Forums Archive
Back the vehicle after death, how? - 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: Back the vehicle after death, how? (/showthread.php?tid=263281)



Back the vehicle after death, how? - tal_peretz - 21.06.2011

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


Re: Back the vehicle after death, how? - tal_peretz - 21.06.2011

Help ?

By the way - the vehicle in virtual world.


Re: Back the vehicle after death, how? - tal_peretz - 22.06.2011

jump


Re: Back the vehicle after death, how? - tal_peretz - 23.06.2011

jump


Re: Back the vehicle after death, how? - Skaizo - 23.06.2011

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



Re: Back the vehicle after death, how? - tal_peretz - 24.06.2011

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

HELP


Re: Back the vehicle after death, how? - tal_peretz - 25.06.2011

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


Re: Back the vehicle after death, how? - tal_peretz - 26.06.2011

jump

HELP PLEASE


Re: Back the vehicle after death, how? - [HiC]TheKiller - 26.06.2011

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