Back the vehicle after death, how?
#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


Messages In This Thread
Back the vehicle after death, how? - by tal_peretz - 21.06.2011, 12:08
Re: Back the vehicle after death, how? - by tal_peretz - 21.06.2011, 18:43
Re: Back the vehicle after death, how? - by tal_peretz - 22.06.2011, 14:09
Re: Back the vehicle after death, how? - by tal_peretz - 23.06.2011, 14:47
Re: Back the vehicle after death, how? - by Skaizo - 23.06.2011, 15:11
Re: Back the vehicle after death, how? - by tal_peretz - 24.06.2011, 15:15
Re: Back the vehicle after death, how? - by tal_peretz - 25.06.2011, 19:31
Re: Back the vehicle after death, how? - by tal_peretz - 26.06.2011, 01:03
Re: Back the vehicle after death, how? - by [HiC]TheKiller - 26.06.2011, 01:49

Forum Jump:


Users browsing this thread: 1 Guest(s)