Help - respawn all cars.
#1

Can anyone make me a command /rac to respawn all unused vehicles...
This is the system i have now:

Код:
YCMD:rac(playerid, params[],help)
{
	    	        new bool:vehicleused[MAX_VEHICLES];
			for(new i=0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
				{
					vehicleused[GetPlayerVehicleID(i)] = true;
				}
			}
			for(new i=1; i < MAX_VEHICLES; i++)
			{
				if(!vehicleused[i])
				{
					SetVehicleToRespawn(i);
				}
			}
}
This system respawn all vehicles that are not used, but now i want something else.
I want if the vehicleid == pInfo[MAX_PLAYERS][AdminCar] - to destroy that vehicle and respawn all the others...
Now i hope that someone understands me...
Reply
#2

Quote:
Originally Posted by Fjclip99
Посмотреть сообщение
Can anyone make me a command /rac to respawn all unused vehicles...
This is the system i have now:

Код:
YCMD:rac(playerid, params[],help)
{
	    	        new bool:vehicleused[MAX_VEHICLES];
			for(new i=0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
				{
					vehicleused[GetPlayerVehicleID(i)] = true;
				}
			}
			for(new i=1; i < MAX_VEHICLES; i++)
			{
				if(!vehicleused[i])
				{
					SetVehicleToRespawn(i);
				}
			}
}
This system respawn all vehicles that are not used, but now i want something else.
I want if the vehicleid == pInfo[MAX_PLAYERS][AdminCar] - to destroy that vehicle and respawn all the others...
Now i hope that someone understands me...
Do you mean this?

Код:
YCMD:rac(playerid, params[],help)
{
	    	        new bool:vehicleused[MAX_VEHICLES];
			for(new i=0; i < MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
				{
					vehicleused[GetPlayerVehicleID(i)] = true;
				}
			}
			for(new i=1; i < MAX_VEHICLES; i++)
			{
                                for(new a=0; a<MAX_PLAYERS; a++)
                                {
                                     if(pInfo[a][AdminCar] == i) DestroyVehicle(i);
                                }
				if(!vehicleused[i])
				{
					SetVehicleToRespawn(i);
				}
			}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)