[HELP] Car Respawner [+REP]
#1

Hello,
I was wondering if somebody may please make me a script where every 3 min all unused cars from /v delete
and all unused cars that are static respawn in there normal place. I will +REP Asap to the first person to
help me.

Thank you.
Reply
#2

Well, This is a command to respawn all cars for admins
Код:
	if(strcmp(cmd, "/respawnallcars", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] < 4)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "** you are not an admin...");
			    return 1;
			}
			new bool:unwanted[MAX_VEHICLES];
			for(new player=0; player<MAX_PLAYERS; player++)
     		{
            	if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
     		}
			for(new car = 1; car <= 1850; car++)
			{
				if(!unwanted[car]) SetVehicleToRespawn(car);
			}
			GameTextForAll("~w~Every Unused Car ~n~~g~Respawned!",5000,1);
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Respawned All Unused Cars",d,m,y,h,mi,s,sendername);
			AdminLog(string);
		}
		return 1;
	}
If you know how to set a timer for something then you will be able to set a timer that makes the above without a command.
Reply
#3

Im sorry, Im just a beginner in PAWNO. May you please make that for me?
Thank you for the help. +REP
Reply
#4

pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "** you are not an admin...");
                return 1;
            }
            new bool:unwanted[MAX_VEHICLES];
            for(new player=0; player<MAX_PLAYERS; player++)
            {
                if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
            }
            for(new car = 1; car <= 1850; car++)
            {
                if(!unwanted[car]) SetVehicleToRespawn(car);
            }
            GameTextForAll("~w~Every Unused Car ~n~~g~Respawned!",5000,1);
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Respawned All Unused Cars",d,m,y,h,mi,s,sendername);
            AdminLog(string);
        }
        return 1;
    }
btw this is viddo's script. Just add it to your script.

- Kudoz
Reply
#5

Quote:
Originally Posted by Kudoz
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] < 4)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "** you are not an admin...");
                return 1;
            }
            new bool:unwanted[MAX_VEHICLES];
            for(new player=0; player<MAX_PLAYERS; player++)
            {
                if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
            }
            for(new car = 1; car <= 1850; car++)
            {
                if(!unwanted[car]) SetVehicleToRespawn(car);
            }
            GameTextForAll("~w~Every Unused Car ~n~~g~Respawned!",5000,1);
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
            format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Respawned All Unused Cars",d,m,y,h,mi,s,sendername);
            AdminLog(string);
        }
        return 1;
    }
btw this is viddo's script. Just add it to your script.

- Kudoz
By the way, This is a defined admin script, just replace your admin system with
Код:
	        if(PlayerInfo[playerid][pAdmin] < 4)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "** you are not an admin...");
			    return 1;
			}
If you want it for Rcon You can just use:
Код:
  if(IsPlayerAdmin(playerid))
  			{
			    SendClientMessage(playerid, COLOR_GRAD1, "** you are not an admin...");
			    return 1;
			}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)