[Ajuda] Respawn veнculos sem uso
#1

Galera uso a ppc_trucking e o meu comando /respawncarros respawna todos os carros do server criados por admins,e eu gostaria que ele respawnasse apenas todos os veнculos do server SEM USO, oque jб tentei vбrias vezes e nгo consegui, serб que alguem pode me ajudar ? abaixo estб o cmd
Код:
COMMAND:respawncarros(playerid, params[])
{
	// Setup local variables
	new CarsDeleted, Msg[128];

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Check if the player's admin-level is at least 3
		if (APlayerData[playerid][PlayerLevel] >= 3)
		{
		    // Loop through all vehicles
		    for (new vid; vid < 2000; vid++)
		    {
				// Check if this vehicle exists (check the model), otherwise all empty slots are processed as well
				if (AVehicleData[vid][Model] != 0)
				{
					// Check if the vehicle is NOT a static vehicle
					if (AVehicleData[vid][StaticVehicle] == false)
					{
						// Check if the vehicle is NOT owned by anybody (this leaves all vehicles spawned with /car, /trailer, /plane)
						if (AVehicleData[vid][Owned] == false)
						{
							// Count the cars that have been deleted
							CarsDeleted++;
							// Delete the vehicle and clear the data
							DestroyVehicle(vid);
							AVehicleData[vid][Owned] = false;
							AVehicleData[vid][Owner] = 0;
							AVehicleData[vid][Model] = 0;
							AVehicleData[vid][PaintJob] = 0;
							for (new i; i < 14; i++)
							    AVehicleData[vid][Components][i] = 0;
							AVehicleData[vid][SpawnX] = 0.0;
							AVehicleData[vid][SpawnY] = 0.0;
							AVehicleData[vid][SpawnZ] = 0.0;
							AVehicleData[vid][SpawnRot] = 0.0;
							AVehicleData[vid][BelongsToHouse] = 0;
						}
					}
				}
		    }

			// Let the player know how many vehicles have been cleaned up
			format(Msg, 128, "{00FF00}Total de veнculos respawnados: {FFFF00}%i", CarsDeleted);
			SendClientMessage(playerid, 0xFFFFFFFF, Msg);
		}
		else
		    return 0;
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Reply


Messages In This Thread
Respawn veнculos sem uso - by Performancetotal - 28.01.2014, 18:50
Re: Respawn veнculos sem uso - by Ley - 28.01.2014, 19:04
Re: Respawn veнculos sem uso - by Performancetotal - 28.01.2014, 19:11
Re: Respawn veнculos sem uso - by SkullFire - 28.01.2014, 19:12
Re: Respawn veнculos sem uso - by Performancetotal - 28.01.2014, 19:21
Re: Respawn veнculos sem uso - by engelguilherme - 31.01.2014, 12:59
Re: Respawn veнculos sem uso - by engelguilherme - 31.01.2014, 13:04

Forum Jump:


Users browsing this thread: 2 Guest(s)