Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

как сделать команду с таймером

Статус
В этой теме нельзя размещать новые ответы.

Kelt

Умник
PHP:
COMMAND:assistance(playerid, params[])
{
	// Setup local variables
	new bool:AssistOnline = false, Msg[128], Name[24];

	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/assistance", params);

	// Check if the player has logged in
	if (APlayerData[playerid][LoggedIn] == true)
	{
		// Get the player's name
		GetPlayerName(playerid, Name, sizeof(Name));
		// Preset the message that needs to be sent to assistance players
		format(Msg, 128, "{00FF00}Водитель {FFFF00}%s{00FF00} сломался, помогите ему срочно!", Name);

		// Check if there is at least one assistance player online
		for (new i; i < MAX_PLAYERS; i++)
		{
			// Check if this player is connected
			if (IsPlayerConnected(i))
			{
				// Check if this player is assistance class
				if (APlayerData[i][PlayerClass] == ClassAssistance)
				{
					// Set the flag to indicate that at least one assistance player is online
				    AssistOnline = true;
				    // Send the assistance player a message to inform him who needs assistance
				    SendClientMessage(i, 0xFFFFFFFF, Msg);
				}
			}
		}

		// Check if there is at least one assistance player online
		if (AssistOnline == true)
		{
			// Set yourself as "AssistanceNeeded"
			APlayerData[playerid][AssistanceNeeded] = true;
			// Let the player know he called for assistance
			SendClientMessage(playerid, 0xFFFFFFFF, "{00FF00}Вы вызвали механика");
		}
		else // No assistance is online
		{
			// Check if the player is the driver of a vehicle
			if (GetPlayerVehicleSeat(playerid) == 0)
			{
				// Fully repair the vehicle (damage value and bodywork)
				RepairVehicle(GetPlayerVehicleID(playerid));
				// Also re-fuel the vehicle
				AVehicleData[GetPlayerVehicleID(playerid)][Fuel] = MaxFuel;
				// Let the player pay for the repairs and refuel (default $35000)
				RewardPlayer(playerid, -35000, 0);
				// Let the player know he spent $35000 for auto-repair because there were no assistance players online
			    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Ваше транспортное средство было починенно и заправлено за 35000 рублей");
			    SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Т.к нету онлайн механика");
			}
		}
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу