Question about respawning cars
#1

Hey guys, Can you help me with making a command that respawns all the server's cars?

like /respawnallcars -> It will respawn everycar


AND: I want something that makes the vehicles respawn whenever I restart the server, please
Reply
#2

Try searching
maybe this works for you
https://sampforum.blast.hk/showthread.php?tid=179200
Reply
#3

Код:
if(strcmp(cmdtext,"/respawncars",true) == 0)
{
   new name[MAX_PLAYER_NAME],string[32];
   GetPlayerName(playerid,name,sizeof(name));
   format(string,sizeof(string),"The player \"%s\" has set the vehicles to respawn.",name);
   SendClientMessageToAll(COLOR,string);
   for(new i = 0; i < MAX_VEHICLES; i++)
   {
       if(IsPlayerInVehicle(i,i))
       {
           RemovePlayerFromVehicle(i);
       }
       SetVehicleToRespawn(i);
  }
  return 1;
}
Reply
#4

Quote:
Originally Posted by Ehab1911
Посмотреть сообщение
AND: I want something that makes the vehicles respawn whenever I restart the server, please
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
Reply
#5

Thanks a lot guys!! It helped me so much! Thanks, Appreciating this!!
Reply
#6

or if u want dcmd

pawn Код:
dcmd_respawncars(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, green, "|- Your have Successfully Respawned all Vehicles! -|");
        GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Vehicles ~g~Respawned!", 3000,3);
       
        for(new cars=0; cars<MAX_VEHICLES; cars++)
        {
            if(!VehicleOccupied(cars))
            {
                SetVehicleToRespawn(cars);
            }
        }
        return 1;
    }
    else return ErrorMessages(playerid, 1);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)