how to freeze vehicles for 5 sec
#7

Quote:
Originally Posted by Madsen
Посмотреть сообщение
okay
at the top:
pawn Код:
forward VehicleOccupied(vehicleid);

public VehicleOccupied(vehicleid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInVehicle(i,vehicleid)) return 1;
    }
    return 0;
}
i use zcmd here is the command
pawn Код:
CMD:respawnallvehicles(playerid, params[])
    {
        for(new cars=0; cars<MAX_VEHICLES; cars++)
         {
            if(!VehicleOccupied(cars))
            {
                SetVehicleToRespawn(cars);
                RepairVehicle(cars);
            }
        }
        return 1;
    }
At the command you are using (eg. /teleport):

pawn Код:
SetTimer("CarRespawn",10000,0); // Change the amount of milisecounds to what you need.
Anywhere :
pawn Код:
forward CarRespawn();
public CarRespawn()
{
    for(new cars=0; cars<MAX_VEHICLES; cars++)
    {
        if(!VehicleOccupied(cars))
        {
            SetVehicleToRespawn(cars);
            RepairVehicle(cars);
        }
   }
return 1;
}
All done.
Reply


Messages In This Thread
how to freeze vehicles for 5 sec - by Iphone1234g - 06.06.2011, 17:11
Re: how to freeze vehicles for 5 sec - by Wesley221 - 06.06.2011, 17:21
Re: how to freeze vehicles for 5 sec - by Madsen - 06.06.2011, 17:23
Re: how to freeze vehicles for 5 sec - by Iphone1234g - 06.06.2011, 17:28
Re: how to freeze vehicles for 5 sec - by Madsen - 06.06.2011, 17:33
Re: how to freeze vehicles for 5 sec - by Iphone1234g - 06.06.2011, 17:42
Re: how to freeze vehicles for 5 sec - by sleepysnowflake - 06.06.2011, 18:04
Re: how to freeze vehicles for 5 sec - by Iphone1234g - 06.06.2011, 18:16
Re: how to freeze vehicles for 5 sec - by Mean - 06.06.2011, 19:38
Re: how to freeze vehicles for 5 sec - by Namaco - 06.06.2011, 19:41

Forum Jump:


Users browsing this thread: 3 Guest(s)