Why doesn't this only destroy the vehicles I tell it to?
#1

Here is the pastebin

http://samp.pastebin.com/m2564cfd9

It should only explode the hunter, rhino and hydra if it leaves the boundaries, but it destroys ALL vehicles outside of the boundaries. Why?
Reply
#2

Like I said in the last post, I don't think that was proper syntax. I guess it wasn't.

pawn Код:
new CarID = GetVehicleModel(GetPlayerVehicleID(i));
if(CarID == 432 || CarID == 425 || CarID == 520)
Replace those lines.
Reply
#3

now it doesn't destroy any vehicle.. i think it might have something to do with new CarID = GetVehicleModel(GetPlayerVehicleID(i));
because isn't a vehicles id specific to that vehicle? not that vehicle type?
Reply
#4

Use DestroyVehicle(playerid,GetPlayerVehicleID(playeri d)); instead of SetVehicleHealth..
Reply
#5

Thanks coole for the help, but I would rather use SetVehicleHealth because instead of just deleting the vehicle, it blows it up, which is the effect I'm looking for
Reply
#6

pawn Код:
public WeaponsVehicleCheck()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerInArea(i,423.9233, 56.4679, 2138.4824, 1681.4557))
        {
            ResetPlayerWeapons(i);
            new CarID = GetVehicleModel(GetPlayerVehicleID(i));
            if(CarID == 432 || CarID == 425 || CarID == 520)
            {
                SetVehicleHealth(CarID,0.0);
            }
        }
    }
}
Try that.
Reply
#7

If it blows up, then it will respawn at hackers ( or some1 elses ) spawn point.
Reply
#8

This isn't to prevent hackers from spawning these. It is so that when someone leaves a deathmatch area I presume in one of these vehicles, it blows them up. It may be easier just to set world boundaries though.
Reply
#9

Why not use SetVehicleToRespawn instead of destroying the vehicle?
Reply
#10

does anyone know why it's not working? i just dont understand why it isn't, it looks like it should. they just dont disappear when i leave the area.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)