DestroyVehicle after it die but in DM !
#1

Hey all, I need really your help in this function

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
DestroyVehicle(vehicleid);
return 1;
}
I need only if player in /dm, and the vehicle explode it will not re-spawn, it will destroy but the other cars out of /dm will re-spawn when it explode !

Thanks at first
Reply
#2

!bump
Reply
#3

Your dm code?
Reply
#4

pawn Код:
new DM_Cars[2];
init
pawn Код:
DM_Cars[0] = AddStaticVehicleEx(... // first car
...
...
...
DM_Cars[1] = AddStaticVehicleEx(... // last dm car
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    if(DM_Cars[0] <= vehicleid <= DM_Cars[1])
        DestroyVehicle(vehicleid);
    return 1;
}
Reply
#5

I have, if player use /dm it will put him in Bloodring, and teleportation to the area !
If he /dmq it will spawn him and destroy his car !

pawn Код:
if(strcmp(cmdtext, "/dm", true) == 0)
    {
        new Float: tmp_A;
        GetPlayerFacingAngle(playerid, tmp_A);
        SetPVarInt(playerid, "d_Car", CreateVehicle(504, -1510.7020, 1014.6202, 1037.8568, tmp_A, -1, -1, -1));
        SetPlayerPos(playerid, -1510.7020,1014.6202,1037.8568);
        SetPlayerInterior(playerid, 15);
        LinkVehicleToInterior(GetPVarInt(playerid, "d_Car"), 15);
        PutPlayerInVehicle(playerid, GetPVarInt(playerid, "d_Car"), 0);
        Bloodring[playerid]=1;
        Dzone[playerid]=1;
        return 1;
    }
pawn Код:
if (strcmp(cmdtext, "/dmq", true) == 0)
    {
        new lastcar;
        lastcar = GetPlayerVehicleID(playerid);
        DestroyVehicle(lastcar);
        Dzone[playerid] = 0;
        Bloodring[playerid]=0;
        SpawnPlayer(playerid);
        RemovePlayerFromVehicle(playerid);
        return 1;
    }
Reply
#6

Anyone ?!
Reply
#7

so save the cars info in a file and laod it.. into dmCars[MAX_VEHICLES];
and check if the car is dm car... if(dmCars[vehid]==1) then it'll destroy them...
Reply
#8

No, I have been found an answer but I forgot it
Look again, it just CreatVehicle not AddStaticVehicle !
Reply
#9

BUMP !
Reply
#10

Please !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)