Доступ к готовым решениям

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

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

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

Мануал ДМ Арена

Saibot

Мастер
Сделал простую ДМ арену, и решил выложить её сюда. Думаю кому-то пригодиться.​

Ко всем new
PHP:
new pickup_death_match,
	weapon_death_match[20],
	Text: death_match_TD[MAX_PLAYERS][2],
	player_on_death_match[MAX_PLAYERS char];
	
new Float: death_match_spawn [7] [3] =
{
    {1742.4236, 737.3909, 10.8203},
    {1743.7966, 684.8660, 10.8203},
    {1649.3705, 778.2451, 10.8203},
    {1639.8262, 671.3956, 10.8203},
    {1587.5753, 686.2494, 10.8203},
    {1644.7056, 749.9665, 10.8203},
    {1732.1228, 719.8817, 10.8203}
};
В public SetPlayerSpawn(playerid)
PHP:
if player_on_death_match{playerid} *then
	return death_match(playerid);
В public OnPlayerDeath(playerid, killerid, reason)
PHP:
if player_on_death_match{playerid} *then
{
	new player_name[MAX_PLAYER_NAME],
		killerid_name[MAX_PLAYER_NAME],
		fmt_str[MAX_PLAYER_NAME + 26];

	GetPlayerName(playerid, player_name, sizeof(player_name));
	GetPlayerName(killerid, killerid_name, sizeof(killerid_name));

	GivePlayerMoney(killerid, 100);
	GivePlayerMoney(playerid, -100);
	
	SetPlayerHealth(killerid, 100);

    SetPVarInt(killerid, !"DM_killed", GetPVarInt(killerid, !"DM_killed") + 1);
    SetPVarInt(playerid, !"DM_kill_me", GetPVarInt(playerid, !"DM_kill_me") + 1);

	strcat(fmt_str, "~g~You killed ");
	strcat(fmt_str, player_name);
	strcat(fmt_str, "  ~n~+100$");
	GameTextForPlayer(killerid, fmt_str, 5000, 4);

    strcat(fmt_str, "~r~Did you kill ");
	strcat(fmt_str, killerid_name);
	strcat(fmt_str, "  ~n~-100$");
	GameTextForPlayer(playerid, fmt_str, 5000,4);

    format(fmt_str, sizeof(fmt_str), "~r~Death: %d"
	,
		GetPVarInt(playerid, !"DM_kill_me")
	);
    TextDrawSetString(death_match_TD[playerid][0], fmt_str);

    format(fmt_str, sizeof(fmt_str), "~g~Killed: %d"
	,
		GetPVarInt(killerid,!"DM_killed")
	);
    TextDrawSetString(death_match_TD[killerid][1], fmt_str);
    return true;
}

В public OnPlayerPickUpPickup(playerid, pickupid)
PHP:
if(pickupid >= weapon_death_match[0] && pickupid <= weapon_death_match[19])
{
	switch(random(20))
	{
		case 0:GiveWeapon(playerid, 9, 40);
		case 1:GiveWeapon(playerid, 16, 3);
		case 2:GiveWeapon(playerid, 17, 3);
		case 3:GiveWeapon(playerid, 18, 3);
		case 4:GiveWeapon(playerid, 24, 40);
		case 5:GiveWeapon(playerid, 25, 20);
		case 6:GiveWeapon(playerid, 27, 50);
		case 7:GiveWeapon(playerid, 34, 10);
		case 8:GiveWeapon(playerid, 32, 100);
		case 9:GiveWeapon(playerid, 8, 10);
		case 10:GiveWeapon(playerid, 28, 50);
		case 11:GiveWeapon(playerid, 30, 100);
		case 12:GiveWeapon(playerid, 31, 100);
		case 13:GiveWeapon(playerid, 33, 20);
		case 14:GiveWeapon(playerid, 39, 5);
		case 15:GiveWeapon(playerid, 34, 10);
		case 16:GiveWeapon(playerid, 31, 100);
		case 17:GiveWeapon(playerid, 30, 100);
		case 18:GiveWeapon(playerid, 34, 10);
		case 19:GiveWeapon(playerid, 28, 100);
	}
}
if(pickupid == pickup_death_match)
{
	death_match(playerid);
	TextDrawShowForPlayer(playerid, death_match_TD[playerid][0]);
	TextDrawShowForPlayer(playerid, death_match_TD[playerid][1]);
	SendClientMessage(playerid, -1, !"Для выхода введите {33aa33}/pexit.");
}
К остальным командам:
PHP:
CMD:pexit(playerid)
{
	if !player_on_death_match{playerid} *then
		return SendClientMessage(playerid, -1, !"Вы не на ДМ Арене.");
		
	DeletePVar(playerid,!"on_arena");
	DeletePVar(playerid,!"DM_killed");
	DeletePVar(playerid,!"DM_kill_me");
	
	SetPlayerPos(playerid, 1310.1230,-1367.9025,13.5420);
	SetPlayerVirtualWorld(playerid, 0);
	ResetPlayerWeapons(playerid);
	
	TextDrawShowForPlayer(playerid, death_match_TD[playerid][0]);
	TextDrawShowForPlayer(playerid, death_match_TD[playerid][1]);
	return true;
}

CMD:tparena(playerid)
	return SetPlayerPos(playerid, 1310.1230,-1367.9025,13.5420);
В public OnGameModeInit()
PHP:
weapon_death_match[0] = CreatePickup(3052,2,1717.9114,720.8976,13.7375,1);
weapon_death_match[1] = CreatePickup(3052,2,1705.2756,715.4815,16.6359,1);
weapon_death_match[2] = CreatePickup(3052,2,1705.8290,730.7913,22.4484,1);
weapon_death_match[3] = CreatePickup(3052,2,1670.4266,727.6653,16.6359,1);
weapon_death_match[4] = CreatePickup(3052,2,1662.0718,721.6697,10.8203,1);
weapon_death_match[5] = CreatePickup(3052,2,1664.5563,708.3632,10.8203,1);
weapon_death_match[6] = CreatePickup(3052,2,1706.6169,686.1367,10.8203,1);
weapon_death_match[7] = CreatePickup(3052,2,1605.3572,769.9839,35.8781,1);
weapon_death_match[8] = CreatePickup(3052,2,1665.1626,702.5118,35.8781,1);
weapon_death_match[9] = CreatePickup(3052,2,1735.8202,740.0356,34.2781,1);
weapon_death_match[10] = CreatePickup(3052,2,1724.1656,694.2397,19.9130,1);
weapon_death_match[11] = CreatePickup(3052,2,1756.1750,684.8340,12.9684,1);
weapon_death_match[12] = CreatePickup(3052,2,1706.4531,763.2916,10.8203,1);
weapon_death_match[13] = CreatePickup(3052,2,1650.9753,775.2101,12.9779,1);
weapon_death_match[14] = CreatePickup(3052,2,1600.9852,732.5337,10.8203,1);
weapon_death_match[15] = CreatePickup(3052,2,1664.9207,669.9620,35.9781,1);
weapon_death_match[16] = CreatePickup(3052,2,1638.5696,681.9730,17.6396,1);
weapon_death_match[17] = CreatePickup(3052,2,1674.6600,767.5822,21.6059,1);
weapon_death_match[18] = CreatePickup(3052,2,1658.6887,739.5748,35.2781,1);
weapon_death_match[19] = CreatePickup(3052,2,1590.7823,688.8644,10.8203,1);
pickup_death_match = CreatePickup(19133,23,1310.1230,-1367.9025,13.5420);

death_match_TD[playerid][0] = TextDrawCreate(10.0, 270, !"~r~Death: 0");
death_match_TD[playerid][1] = TextDrawCreate(10.0, 250, !"~g~Killed: 0");
for(new a; a != 2; a++)
{
	TextDrawColor(death_match_TD[playerid][a], 0xff0000ff);
	TextDrawUseBox(death_match_TD[playerid][a], 1);
	TextDrawBoxColor(death_match_TD[playerid][a], 0x00000070);
	TextDrawSetShadow(death_match_TD[playerid][a], 1);
	TextDrawSetOutline(death_match_TD[playerid][a], 1);
	TextDrawBackgroundColor(death_match_TD[playerid][a], 0x000000ff);
	TextDrawFont(death_match_TD[playerid][a], 1);
	TextDrawSetProportional(death_match_TD[playerid][a], 1);
	TextDrawTextSize(death_match_TD[playerid][a], 55.0, 55.0);
	TextDrawLetterSize(death_match_TD[playerid][a], 0.2,1.1);
}

CreateObject(987, 1710.50000, 769.00000, 12.30000,   0.00000, 0.00000, 0.00000);
CreateObject(8255, 1665.56250, 753.82813, 14.39063,   0.00000, 0.00000, 0.00000);
CreateObject(8078, 1634.71875, 772.84375, 13.82031,   0.00000, 0.00000, 0.00000);
CreateObject(8885, 1606.59998, 709.20001, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8885, 1675.00000, 738.90002, 20.60000,   0.00000, 0.00000, 0.00000);
CreateObject(8885, 1674.59998, 770.50000, 20.60000,   0.00000, 0.00000, 0.00000);
CreateObject(9588, 1686.09998, 721.29999, 16.30000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1743.90002, 758.59998, 13.30000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1740.09998, 663.20001, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1741.50000, 747.00000, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1743.09998, 697.00000, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1734.69995, 710.59998, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1735.00000, 731.40002, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1705.50000, 698.70001, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1683.19995, 698.90002, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8884, 1626.30005, 757.09998, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8884, 1626.90002, 682.79999, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8884, 1634.19995, 711.20001, 13.20000,   0.00000, 0.00000, 270.00000);
CreateObject(8884, 1634.19995, 733.20001, 13.20000,   0.00000, 0.00000, 270.00000);
CreateObject(8884, 1616.50000, 724.90002, 13.20000,   0.00000, 0.00000, 270.00000);
CreateObject(8884, 1695.00000, 764.20001, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8078, 1686.30005, 742.59998, 13.80000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1587.19995, 737.20001, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1586.90002, 702.70001, 13.30000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1595.40002, 729.20001, 13.20000,   0.00000, 0.00000, 272.00000);
CreateObject(8886, 1595.80005, 720.20001, 13.20000,   0.00000, 0.00000, 272.00000);
CreateObject(10009, 1608.00000, 728.50000, 14.40000,   0.00000, 0.00000, 312.00000);
CreateObject(3279, 1735.50000, 769.20001, 17.30000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1735.69995, 740.20001, 17.20000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1735.00000, 673.00000, 17.30000,   0.00000, 0.00000, 88.00000);
CreateObject(3279, 1735.59998, 702.79999, 17.20000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1664.19995, 670.09998, 18.90000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1665.59998, 702.20001, 18.80000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1604.00000, 672.40002, 18.70000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1605.30005, 703.09998, 18.90000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1606.09998, 738.59998, 19.00000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1605.09998, 770.00000, 18.80000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1661.09998, 770.09998, 18.60000,   0.00000, 0.00000, 0.00000);
CreateObject(3279, 1659.09998, 739.00000, 18.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1655.00000, 710.59998, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1654.69995, 717.09998, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(8886, 1654.50000, 723.90002, 13.20000,   0.00000, 0.00000, 0.00000);
CreateObject(18769, 1587.28455, 663.57703, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1607.25354, 663.58478, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1627.20825, 663.58728, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1647.16895, 663.58911, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1667.09314, 663.59552, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1726.93738, 663.60193, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1746.89185, 663.60632, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1706.98999, 663.60071, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1687.03027, 663.59442, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1577.33838, 673.57489, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1577.31323, 693.54529, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1577.32764, 713.49811, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1577.33240, 733.42993, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1577.32788, 753.38312, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1577.33594, 773.33337, 19.17503,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1756.79395, 672.94971, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1756.78784, 692.90973, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1756.79163, 712.85059, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1756.79333, 732.73981, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1756.80115, 752.68671, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1756.79980, 772.64789, 19.17500,   90.00000, 0.00000, 90.00000);
CreateObject(18769, 1747.47461, 783.24237, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1727.49780, 783.24573, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1707.53406, 783.25189, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1687.58423, 783.25787, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1667.62891, 783.26093, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1647.65955, 783.26007, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1627.71912, 783.25909, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1607.80066, 783.24939, 19.17500,   90.00000, 0.00000, 0.00000);
CreateObject(18769, 1587.92798, 783.25787, 19.17500,   90.00000, 0.00000, 0.00000);
В конец мода:
PHP:
stock death_match(playerid)
{
    new rand = random(sizeof(death_match_spawn));
    SetPlayerPos(playerid
	,
		death_match_spawn[rand][0],
		death_match_spawn[rand][1],
		death_match_spawn[rand][2]
	);

    SetPVarInt(playerid, !"on_arena",1);
    SetPlayerColor(playerid, 0xCEA6DFFF);

    ResetPlayerWeapons(playerid);
	GiveWeapons(playerid, 24, 40);
    SetPlayerVirtualWorld(playerid, 50);
	SetPlayerHealth(playerid, 100);

    return true;
}
Скриншоты:


Автор: Saibot
 
Последнее редактирование:
Сверху Снизу