Destroying empty cars
#1

Hi,
I am making a sumo server atm, and it is now working fine but when it loads a new map, it spawns some vehicles from the previous round, i need a script that automaticly destroys the cars without a driver.
Could you guys help me? I realy need it.
Reply
#2

Please help me, i need this.
Reply
#3

Use this https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#4

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
That's not helpful


Anyways, you could loop through all the cars, check if they have a player in them, and destroy all the empty ones
Reply
#5

not sure it helps u out, or maybe u have already tryed that, but inject driver and then destroy?
Reply
#6

pawn Код:
for (new i = 0; i < MAX_VEHICLES; i++)
{
    new found = 0;
    for (new a = 0; a < MAX_PLAYERS; a++)
    {
        if (GetPlayerVehicleID(a) == i)
        {
            found = 1;
            break;

        }
    }

    if (!found)
    {
        DestroyVehicle(i);
    }
}
Reply
#7

Thnx, it helped me .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)