SA-MP Forums Archive
Help with respawn all cars - 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)
+--- Thread: Help with respawn all cars (/showthread.php?tid=535645)



Help with respawn all cars - buburuzu19 - 05.09.2014

pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(playerVariables[playerid][pAdminLevel] < 3)
            {
                SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
                return 1;
            }
            new samp[256];
            SetTimer("RACtime", 3000, 0);
            format(samp, 256,"{FFFFFF}All unused cars well be respawned in {009999}3 {FFFFFF}seconds by %s!",playerVariables[playerid][pNormalName]);
            submitToAdmins(samp, -1);
        }
        return 1;
    }
pawn Код:
public ractime(playerid)
{
      new string[256];
      new bool:unwanted[CAR_AMOUNT];
      for(new player=0; player<MAX_PLAYERS; player++)
      {
        if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
      }
      for(new car = 1; car <= MAX_VEHICLES; car++)
      {
        if(!unwanted[car]) SetVehicleToRespawn(car);
      }
      return 1;
}
pawn Код:
public RACtime(playerid)
{
      for(new player=0; player<MAX_PLAYERS; player++)
      {
      if(!IsVehicleOccupied(player)) SetVehicleToRespawnEx(player);
      }
      for(new car = 1; car <= 1300; car++)
      {
          if(!IsVehicleOccupied(car)) SetVehicleToRespawnEx(car);

      }
      return 1;
}
So i want to don't respawn the TRUCKER trailers because, when i type /rac it respawns all cars including trailers.


Re: Help with respawn all cars - TheNerka - 05.09.2014

SetTimer("RACtime", 3000, 0);
you timer this, but public ractime

try SetTimer("ractime", 3000, 0);


Re: Help with respawn all cars - buburuzu19 - 05.09.2014

What is with your post? You didn't read all my post.
All my command is working properly but i want to don't respawn the truck trailers.
pawn Код:
So i want to don't respawn the TRUCKER trailers because, when i type /rac it respawns all cars including trailers.



Re: Help with respawn all cars - TheNerka - 05.09.2014

see this post and comments

https://sampforum.blast.hk/showthread.php?tid=374169 i mean work


Re: Help with respawn all cars - buburuzu19 - 05.09.2014

i Want to don't respawn it , this link shows you how can respawn it


Re: Help with respawn all cars - buburuzu19 - 05.09.2014

UP !