SA-MP Forums Archive
how to freeze vehicles for 5 sec - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to freeze vehicles for 5 sec (/showthread.php?tid=259934)



how to freeze vehicles for 5 sec - Iphone1234g - 06.06.2011

hello guys plz tell me how i can freeze vehicles for 5 sec for loading objects i make some custom maps and vehicles go in water i want to freeze vehicles for 5 sec


Re: how to freeze vehicles for 5 sec - Wesley221 - 06.06.2011

Just let them spawn a little bit higher, dont think you can freeze vehicles


Re: how to freeze vehicles for 5 sec - Madsen - 06.06.2011

hmm maybe you can make a respawnallvehicles command? i got 1 if you want it.


Re: how to freeze vehicles for 5 sec - Iphone1234g - 06.06.2011

okey plz post code /respawnallcar >who respawn all unused cars@@


Re: how to freeze vehicles for 5 sec - Madsen - 06.06.2011

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;
    }



Re: how to freeze vehicles for 5 sec - Iphone1234g - 06.06.2011

plz addd timer man i want its respawn all cars on every 5 sec here is no other way to do more


Re: how to freeze vehicles for 5 sec - sleepysnowflake - 06.06.2011

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.


Re: how to freeze vehicles for 5 sec - Iphone1234g - 06.06.2011

i got this error plz check this!!!!

Quote:

H:\Documents and Settings\Bilawal2o5o\Desktop\poilts life\gamemodes\gtapilots.pwn(4461) : error 017: undefined symbol "VehicleOccupied"
H:\Documents and Settings\Bilawal2o5o\Desktop\poilts life\gamemodes\gtapilots.pwn(4467) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.




Re: how to freeze vehicles for 5 sec - Mean - 06.06.2011

If you are using a streamer, just do
pawn Код:
Streamer_UpdateEx( playerid, x, y, z );
If not, freeze a player for 3 seconds(5 is too much), I think it does affect vehicles, never tested out tho.


Re: how to freeze vehicles for 5 sec - Namaco - 06.06.2011

All I can see here is like hes using u guys like slaves but saying please...

Time to learn how to script mate.