Заявка за редактиране на плъгин [Knife Duels] - да се направят по-големи дуелите

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Отговори
Потребителски аватар

Автор на темата
summertime vibes PSA
Тестов модератор
Тестов модератор
Мнения: 951
Регистриран: 27 ное 2016, 17:47
Местоположение: In the Heaven
Се отблагодари: 39 пъти
Получена благодарност: 74 пъти
Контакти:

Заявка за редактиране на плъгин [Knife Duels] - да се направят по-големи дуелите

Мнение от summertime vibes PSA » 13 мар 2019, 17:35

Здравейте,
Искам да се редактира кода по-долу, като искам дуелите да са по-големи. В момента са малки дуелите и прекалено бързо се spawn-ват играчите и няма никакво време за реакция ако играят Rush Only (само W).

Код: Избери всички

#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <cstrike>

new const INFO[3][] = 
{ 
	"Knife duels",
        "1.0",
        "Invisible" 
}
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif

new Float:vSizeMin[3], Float:vSizeMax[3], Float:vAngles[3];
new const gModel[] = "models/huehue_wall.mdl";
new const gCName[] = "info_target";
enum { X, Y, Z };
new bool:in_Duel[MAX_PLAYERS+1];
new g_Challenge[MAX_PLAYERS+1];
new g_Area[MAX_PLAYERS+1] = 0;
new g_DuelK[MAX_PLAYERS+1] = 0;
new g_DuelC[MAX_PLAYERS+1] = 0;
new g_MenuCallback;
new bool:Arena1in = false;
new bool:Arena2in = false;
new bool:Arena3in = false;
new bool:Arena4in = false;
new bool:Arena5in = false;
new bool:Arena6in = false;

public plugin_init() 
{
	register_plugin(INFO[0x00], INFO[0x01], INFO[0x02]);
	register_clcmd("say /kd","choose_playermenu");
	register_clcmd("say_team /kd","choose_playermenu");
	register_clcmd("say /knifeduel","choose_playermenu");
	register_clcmd("say_team /knifeduel","choose_playermenu");
	g_MenuCallback = menu_makecallback("menuitem_callback");
	RegisterHam(Ham_Touch, "weaponbox", "hamTouchWeapon");
	RegisterHam(Ham_Touch, "armoury_entity", "hamTouchWeapon");
	RegisterHam(Ham_Touch, "weapon_shield", "hamTouchWeapon");
	RegisterHam(Ham_TakeDamage, "player", "TakeDMG");
	RegisterHam(Ham_Killed, "player", "PlayerKilled");
	RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
	set_task(300.0, "Advert", _,_,_, "b");
}

public plugin_precache()
{
	precache_model(gModel);
}
public client_command(id)
{
        static const szJoinCommand[] = "jointeam";
	static const szJoinCommand1[] = "chooseteam";
        static szCommand[10];
        read_argv(0, szCommand, 9);
        if (equal(szCommand, szJoinCommand)
        && CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT)
        {
                return PLUGIN_HANDLED;
        }
	if (equal(szCommand, szJoinCommand1))
	{
		return PLUGIN_HANDLED;
	}
        return PLUGIN_CONTINUE;
}  
public Advert()
{
	print_cc(0, "!t[!gKnife Duels!t] By: !gInvisible!t.");
	print_cc(0, "!t[!gKnife Duels!t] Type !g/kd !tor !g/knifeduel !tto open the knife duel menu.");
}
public hamTouchWeapon(id)
{
	return 4;
}
public TakeDMG(victim, idinflictor, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
{
	if (victim != attacker)
	{
		if (in_Duel[victim] && !in_Duel[attacker])
		{
			return 4;
		}
	}
	return 1;
}
public PlayerKilled(victim, killer, shouldgib)
{
	if (is_user_alive(killer))
	{
		new victimname[32] , attackername[32];
		get_user_name(victim, victimname, 31);
		get_user_name(killer, attackername, 31);
		if (victim != killer && killer != 0 )
		{
			if (in_Duel[killer] && in_Duel[victim])
			{
				if (killer)
				{
					g_DuelK[killer]+=1;
				}
				if (g_Challenge[killer])
				{
					g_DuelC[g_Challenge[killer]]+=1;
				}
			}
		}
		if (in_Duel[killer] && in_Duel[victim])
		{
			if(g_DuelK[killer]<10 && g_DuelC[g_Challenge[killer]]<10)
			{
				if (!g_Challenge[victim])
				{
					set_task(0.1, "GoToSpawn", killer);
					set_task(0.1, "GoToSpawn", g_Challenge[victim]);
				}
				else
				{
					set_task(0.1, "GoToSpawn", g_Challenge[killer]);
					set_task(0.1, "GoToSpawn", victim);
				}
				client_printc(killer, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t.", attackername, g_DuelK[killer], g_DuelK[victim], victimname);
				client_printc(victim, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t.", victimname, g_DuelK[victim], g_DuelK[killer], attackername);
			}
			else
			{
				if (victim)
				{
					print_cc(0, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t. Winner - !g%s",
					attackername,
					g_DuelC[g_Challenge[killer]],
					g_DuelK[victim],
					victimname,
					attackername);
					DisableChecks(victim);
					set_task(0.1, "GoToSpawn", killer);
					set_task(0.1, "GoToSpawn", victim);
				}
				if (g_Challenge[victim])
				{
					print_cc(0, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t. Winner - !g%s",
					attackername,
					g_DuelK[killer],
					g_DuelC[g_Challenge[victim]],
					victimname,
					attackername);
					DisableChecks(g_Challenge[victim]);
					set_task(0.1, "GoToSpawn", killer);
					set_task(0.1, "GoToSpawn", victim);
				}
				g_DuelC[killer] = 0;
				g_DuelK[victim] = 0;
                                g_DuelC[victim] = 0;
				g_DuelK[killer] = 0;
			}
		}
	}
}
public PlayerSpawn(id)
{
	if (is_user_alive(id))
	{
		if (in_Duel[id])
		{
			whileinduel(id);
			set_user_health(g_Challenge[id], 35);
		}
	}
	if (is_user_alive(g_Challenge[id]))
	{
		if (in_Duel[g_Challenge[id]])
		{
			whileinduel(g_Challenge[id]);
			set_user_health(id, 35);
		}
	}
}
public whileinduel(id)
{
	switch (g_Area[id])
	{
		case 1:
		{
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{738, 327, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1207, 327, -360});
		}
		case 2:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{738, -2252, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1207, -2252, -360});
		}
		case 3:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{1368, 327, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1847, 327, -360});
		}
		case 4:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{88, -2252, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{566, -2252, -360});
		}
		case 5:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{88, 327, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{566, 327, -360});
		}
		case 6:
		{
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{1368, -2252, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1847, -2252, -360});
		}
	}
}
public GoToSpawn(killer) {ExecuteHamB(Ham_CS_RoundRespawn, killer);}
public DisableChecks(id)
{	
	if(in_Duel[id])
	{
		if (!g_Area[id])
		{
			switch (g_Area[g_Challenge[id]])
			{
				case 1:
				{
					Arena1in = false;
				}
				case 2:
				{
					Arena2in = false;
				}
				case 3:
				{
					Arena3in = false;
				}
				case 4:
				{
					Arena4in = false;
				}
				case 5:
				{
					Arena5in = false;
				}
				case 6:
				{
					Arena6in = false;
				}
			}
			dArena(g_Area[g_Challenge[id]]);
			g_Area[g_Challenge[id]] = 0;
		}
		else
		{
			switch (g_Area[id])
			{
				case 1:
				{
					Arena1in = false;
				}
				case 2:
				{
					Arena2in = false;
				}
				case 3:
				{
					Arena3in = false;
				}
				case 4:
				{
					Arena4in = false;
				}
				case 5:
				{
					Arena5in = false;
				}
				case 6:
				{
					Arena6in = false;
				}
			}
			dArena(g_Area[id]);	
			g_Area[id] = 0;
		}
		in_Duel[g_Challenge[id]] = false;
		in_Duel[id] = false;
	}
	if(g_Challenge[id])
	{
		g_Challenge[g_Challenge[id]] = 0;
		g_Challenge[id] = 0;
	}
}
public client_disconnected(id)
{
	new cname[32], ccname[32];
	get_user_name(g_Challenge[id], ccname, 31);
	get_user_name(g_Challenge[g_Challenge[id]], cname, 31);
	if (in_Duel[g_Challenge[id]])
	{
		set_task(0.1, "GoToSpawn", g_Challenge[id]);
		client_printc(g_Challenge[id], "!t[!gKnife Duels!t] !g%s !thas disconnected.", cname);
	}
	if (in_Duel[g_Challenge[g_Challenge[id]]])
	{
		set_task(0.1, "GoToSpawn", g_Challenge[g_Challenge[id]]);
		client_printc(g_Challenge[g_Challenge[id]], "!t[!gKnife Duels!t] !g%s !thas disconnected.", ccname);
	}
	g_DuelC[g_Challenge[id]] = 0;
	g_DuelC[id] = 0;
	g_DuelK[g_Challenge[id]] = 0;
	g_DuelK[id] = 0;
	DisableChecks(id);
}
public choose_playermenu(Challenger, Challenged)
{
	if (!in_Duel[Challenger] && is_user_alive(Challenger))
	{
		if (Arena1in && Arena2in && Arena3in && Arena4in && Arena5in && Arena6in)
		{
			client_printc(Challenger, "!t[!gKnife Duels!t] All the knife duel arenas are in use.");
			return PLUGIN_HANDLED
		}
	}
	if (in_Duel[Challenger])
	{
		return PLUGIN_HANDLED
	}
	if (!is_user_alive(Challenger))
	{
		return PLUGIN_HANDLED
	}
	new menu = menu_create( "\y[\rKnife Duels\y]", "choose_playermenu_handler");
	menu_additem(menu, "\r[!]\yUpdate players\r[!]^n\yChallenge a player:", "0", 0);
	new players[32], pnum;
	new szName[32], szTempid[32], Desc[64];
	get_players(players, pnum);
	for (new i; i<pnum; i++)
	{
		Challenged = players[i];
		if (is_user_alive(Challenged) && (Challenger != Challenged))
		{
			get_user_name(Challenged, szName, charsmax(szName));
			formatex(Desc, charsmax(Desc), in_Duel[Challenged] ? "\d%s \y[\rIn duel\y]" : "%s", szName);
			num_to_str(Challenged, szTempid, charsmax(szTempid));
			menu_additem(menu, Desc, szTempid, 0, g_MenuCallback);
		}
	}
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(Challenger, menu, 0);
	return PLUGIN_HANDLED
}
public menuitem_callback(Challenger, menu, item)
{
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data, charsmax(data), szName,charsmax(szName), callback);
	new tempid = str_to_num(data);
	if (in_Duel[tempid] || !is_user_alive(tempid))
	{
		return ITEM_DISABLED;
	}
	return ITEM_ENABLED;
}
public choose_playermenu_handler(Challenger, menu, item)
{
	if (item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName, charsmax(szName), callback);
	new tempid = str_to_num(data);
	switch(item)
    	{
        	case 0:
        	{
			choose_playermenu(Challenger, Challenger);
		}
	}
	if (is_user_alive(tempid) && !in_Duel[tempid])
	{
		g_Challenge[Challenger] = tempid;
		g_Challenge[tempid] = Challenger;
		Questionm(tempid);
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public Questionm(Challenged) 
{
	if (is_user_alive(Challenged) && is_user_alive(g_Challenge[Challenged]))
	{
		new szAddItemText[555 char], ChallengerName[32];
		get_user_name(g_Challenge[Challenged], ChallengerName, 31);
		format(szAddItemText, charsmax(szAddItemText), "\y[\rKnife Duels\y]^n\wKnife duel vs. \r%s\w?", ChallengerName);
		new menu = menu_create(szAddItemText, "Questionm_handler")
		menu_additem(menu, "\yYes", "1", 0);
		menu_additem(menu, "\rNo", "2", 0);
		menu_setprop(menu, MPROP_PERPAGE, 0);
		menu_display(Challenged, menu, 0);
		return PLUGIN_HANDLED
	}
	/*else 
	{ 
		return PLUGIN_HANDLED 
	}*/
	return PLUGIN_HANDLED
}
public Questionm_handler(Challenged, menu, item)
{	
	new data[6], szName[64], ccname[32], cname[32];
	new access, callback;
	menu_item_getinfo(menu, item, access, data, charsmax(data), szName, charsmax(szName), callback);
	new key = str_to_num(data);
	get_user_name(Challenged, ccname, 31);
	get_user_name(g_Challenge[Challenged], cname, 31);
	switch(key)
	{
		case 1:
		{
			if (in_Duel[g_Challenge[Challenged]])
			{
				if (task_exists(Challenged))
				{
					menu_destroy(menu);
					remove_task(Challenged);
				}
				client_printc(Challenged, "!t[!gKnife Duels!t] !gYou !twere late, !g%s !tis in duel right now.", cname);
				DisableChecks(Challenged);
				return PLUGIN_HANDLED
			}
			if (!is_user_alive(Challenged))
			{
				if (task_exists(Challenged))
				{
					menu_destroy(menu);
					remove_task(Challenged);
				}
				client_printc(Challenged, "!t[!gKnife Duels!t] !gYou !tare !gdead!t.", ccname);
				DisableChecks(Challenged);
				return PLUGIN_HANDLED
			}
			if (!is_user_alive(g_Challenge[Challenged]))
			{
				if (task_exists(Challenged))
				{
					menu_destroy(menu);
					remove_task(Challenged);
				}
				client_printc(Challenged, "!t[!gKnife Duels!t] !g%s !thas !gdied/disconnected!t.", cname);
				DisableChecks(Challenged);
				return PLUGIN_HANDLED
			}
			if (task_exists(Challenged))
			{
				menu_destroy(menu);
				remove_task(Challenged);
			}
			if (!g_Challenge[Challenged])
			{
				menu_destroy(menu);
				return PLUGIN_HANDLED
			}
			else
			{
				choose_area(Challenged);
				client_printc(g_Challenge[Challenged], "!t[!gKnife Duels!t] !g%s !taccepted the duel.", ccname);
				in_Duel[Challenged] = true;
				in_Duel[g_Challenge[Challenged]] = true;
			}
			return PLUGIN_HANDLED
		}
		case 2:
		{
			if (task_exists(Challenged))
			{
				menu_destroy(menu);
				remove_task(Challenged);
			}
			client_printc(g_Challenge[Challenged], "!t[!gKnife Duels!t] !g%s !trefused the duel.", ccname);
			DisableChecks(Challenged);
			return PLUGIN_HANDLED
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED
}

public choose_area(Challenged)
{
	if (cs_get_user_team(g_Challenge[Challenged]) == cs_get_user_team(Challenged))
	{
    		switch (cs_get_user_team(g_Challenge[Challenged]))
		{
        		case (CS_TEAM_CT):
			{
				cs_set_user_team(Challenged, CS_TEAM_T, CS_T_LEET);
        		}
        		case (CS_TEAM_T):
			{
				cs_set_user_team(Challenged, CS_TEAM_CT, CS_CT_GIGN);
       			}
    		}
	}
	g_Area[Challenged] = 1;
	switch (g_Area[Challenged])
	{
		case 1:
		{
			if (Arena1in) { g_Area[Challenged]+=1; }
			switch (g_Area[Challenged])
			{
				case 2:
				{
					if (Arena2in) { g_Area[Challenged]+=1; }
					switch (g_Area[Challenged])
					{
						case 3:
						{
							if (Arena3in) { g_Area[Challenged]+=1; }
							switch (g_Area[Challenged])
							{
								case 4:
								{
									if (Arena4in) { g_Area[Challenged]+=1; }
									switch (g_Area[Challenged])
									{
										case 5:
										{
											if (Arena5in) { g_Area[Challenged]+=1; }
											switch (g_Area[Challenged])
											{
												case 6:
												{
													if (Arena6in)
													{
														new cccname[32];
														get_user_name(Challenged, cccname, 31);
														client_printc(Challenged, "!t[!gKnife Duels!t] All the knife duel arenas are in use, you were too late.");
														client_printc(g_Challenge[Challenged], "!t[!gKnife Duels!t] All the knife duel arenas are in use, !g%s !twas too late with his/her decision", cccname);
														DisableChecks(Challenged);
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	startduel(Challenged);
}

public startduel(Challenged)
{
	if (task_exists(Challenged))
	{
		remove_task(Challenged);
	}
	set_user_health(Challenged, 35);
	set_user_health(g_Challenge[Challenged], 35);
   	set_user_armor(Challenged, 0);
	set_user_armor(g_Challenge[Challenged], 0);
	strip_user_weapons(Challenged);
	strip_user_weapons(g_Challenge[Challenged]);
	give_item(Challenged, "weapon_knife");
	give_item(g_Challenge[Challenged], "weapon_knife");
	set_user_maxspeed(Challenged, 250.0);
	set_user_maxspeed(g_Challenge[Challenged], 250.0);
	set_user_gravity(Challenged, 1.0);
	set_user_gravity(g_Challenge[Challenged], 1.0);
	switch (g_Area[Challenged])
	{
		case 1:
		{
			Arena1in = true; 
			Arena1();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{738, 327, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1207, 327, -360});
		}
		case 2:
		{
			Arena2in = true; 
			Arena2();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{738, -2252, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1207, -2252, -360});
		}
		case 3:
		{
			Arena3in = true; 
			Arena3();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{1368, 327, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1847, 327, -360});
		}
		case 4:
		{
			Arena4in = true; 
			Arena4();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{88, -2252, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{566, -2252, -360});
		}
		case 5:
		{
			Arena5in = true; 
			Arena5();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{88, 327, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{566, 327, -360});
		}
		case 6:
		{
			Arena6in = true; 	
			Arena6();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{1368, -2252, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1847, -2252, -360});
		}
	}
	return PLUGIN_HANDLED
}


public Arena1()
{
	createBlock(Float:{775.065368, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{775.065368, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{775.065368, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{903.065368, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{903.065368, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{903.065368, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{1031.065429, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{1031.065429, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{1031.065429, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{1159.065429, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{1159.065429, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{1159.065429, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{775.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{903.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{1031.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{1159.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{708.103942, 454.809265, -334.000000}, X, 1);
	createBlock(Float:{708.103942, 326.809265, -334.000000}, X, 1);
	createBlock(Float:{708.103942, 198.809265, -334.000000}, X, 1);
	createBlock(Float:{1227.110351, 455.312744, -333.000000}, X, 1);
	createBlock(Float:{1227.110351, 327.312744, -333.000000}, X, 1);
	createBlock(Float:{1227.110351, 199.312744, -333.000000}, X, 1);
}
public Arena2()
{
	createBlock(Float:{775.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{775.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{775.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{903.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{903.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{903.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{1031.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{1031.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{1031.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{1159.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{1159.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{1159.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{775.384826, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{903.384826, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{1031.384765, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{1159.384765, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{707.239074, -2250.012207, -333.000000}, X, 2);
	createBlock(Float:{707.239074, -2122.012207, -333.000000}, X, 2);
	createBlock(Float:{707.239074, -2378.012207, -333.000000}, X, 2);
	createBlock(Float:{1227.693481, -2120.965332, -333.000000}, X, 2);
	createBlock(Float:{1227.693481, -2248.965332, -333.000000}, X, 2);
	createBlock(Float:{1227.693481, -2376.965332, -333.000000}, X, 2);	
}
public Arena3()
{
	createBlock(Float:{1415.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1415.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1415.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1543.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1543.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1543.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1671.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1671.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1671.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1799.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1799.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1799.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1415.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1543.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1671.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1799.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1347.110351, 455.312744, -333.000000}, X, 3);
	createBlock(Float:{1347.110351, 199.312744, -333.000000}, X, 3);
	createBlock(Float:{1347.110351, 327.312744, -333.000000}, X, 3);
	createBlock(Float:{1867.993286, 199.052581, -334.000000}, X, 3);
	createBlock(Float:{1867.993286, 327.052581, -334.000000}, X, 3);
	createBlock(Float:{1867.993286, 455.052581, -334.000000}, X, 3);	
}
public Arena4()
{
	createBlock(Float:{135.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{135.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{135.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{263.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{263.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{263.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{391.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{391.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{391.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{519.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{519.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{519.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{135.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{263.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{391.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{519.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{67.456420, -2122.505859, -334.000000}, X, 4);
	createBlock(Float:{67.456420, -2250.505859, -334.000000}, X, 4);
	createBlock(Float:{67.456420, -2378.505859, -334.000000}, X, 4);
	createBlock(Float:{587.239074, -2122.012207, -333.000000}, X, 4);
	createBlock(Float:{587.239074, -2250.012207, -333.000000}, X, 4);
	createBlock(Float:{587.239074, -2378.012207, -333.000000}, X, 4);
}
public Arena5()
{
	createBlock(Float:{135.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{135.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{135.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{263.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{263.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{263.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{391.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{391.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{391.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{519.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{519.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{519.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{135.254165, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{263.254150, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{391.254150, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{519.254150, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{68.532188, 326.920654, -333.000000}, X, 5);
	createBlock(Float:{68.532188, 198.920654, -333.000000}, X, 5);
	createBlock(Float:{68.532188, 454.920654, -333.000000}, X, 5);
	createBlock(Float:{586.069213, 327.133148, -334.000000}, X, 5);
	createBlock(Float:{586.069213, 199.133148, -334.000000}, X, 5);
	createBlock(Float:{586.069213, 455.133148, -334.000000}, X, 5);	
}
public Arena6()
{
	createBlock(Float:{1415.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1415.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1415.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1543.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1543.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1543.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1671.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1671.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1671.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1799.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1799.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1799.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1415.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1543.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1671.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1799.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1348.344604, -2377.144531, -333.000000}, X, 6);
	createBlock(Float:{1348.344604, -2249.144531, -333.000000}, X, 6);
	createBlock(Float:{1348.344604, -2121.144531, -333.000000}, X, 6);
	createBlock(Float:{1867.397583, -2377.233154, -333.000000}, X, 6);
	createBlock(Float:{1867.397583, -2249.233154, -333.000000}, X, 6);
	createBlock(Float:{1867.397583, -2121.233154, -333.000000}, X, 6);
}

/* Do not touch this values ! */
#define SIZE_P64 64.0
#define SIZE_N64 -64.0
#define SIZE_P4 4.0
#define SIZE_N4 -4.0 
#define SPECIFIC_ANGLE 0.0 /* 90.0 */

stock bool:createBlock(Float:vOrigin[3], const blocktype, const aclass)
{ 
   	new ent = create_entity(gCName);
   	if (is_valid_ent(ent)) 
   	{
		switch (aclass)
		{
			case 1:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaA");
			}
			case 2:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaB");
			}
			case 3:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaC");
			}
			case 4:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaD");
			}
			case 5:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaE");
			}
			case 6:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaF");
			}
		}

		entity_set_int(ent, EV_INT_solid, SOLID_BBOX); 
		entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE); 
		entity_set_model(ent, gModel);

		switch (blocktype)
		{
			//walls 2 ( - ) SIDES
			case X:
			{
				vSizeMin[0] = SIZE_N4; vSizeMin[1] = SIZE_N64; vSizeMin[2] = SIZE_N64;
				vSizeMax[0] = SIZE_P4; vSizeMax[1] = SIZE_P64; vSizeMax[2] = SIZE_P64;
				vAngles[0] = 90.0; vAngles[1] = 0.0; vAngles[2] = 0.0;
				set_rendering(ent, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
			}
			//walls 1 ( | ) from base to base
			case Y:
			{
				vSizeMin[0] = SIZE_N64; vSizeMin[1] = SIZE_N4; vSizeMin[2] = SIZE_N64;
				vSizeMax[0] = SIZE_P64; vSizeMax[1] = SIZE_P4; vSizeMax[2] = SIZE_P64;
				vAngles[0] = 90.0; vAngles[1] = 0.0; vAngles[2] = 90.0;
				set_rendering(ent, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
			}
			//bottom, top
			case Z:
			{
				vSizeMin[0] = SIZE_N64; vSizeMin[1] = SIZE_N64; vSizeMin[2] = SIZE_N4;
				vSizeMax[0] = SIZE_P64; vSizeMax[1] = SIZE_P64; vSizeMax[2] = SIZE_P4;
				vAngles[0] = SPECIFIC_ANGLE; vAngles[1] = 0.0; vAngles[2] = 0.0;
			}
		}

		entity_set_vector(ent, EV_VEC_angles, vAngles);
		entity_set_size(ent, vSizeMin, vSizeMax);
		entity_set_origin(ent, vOrigin);

		return true; 
   	}
	return false; 
}
stock dArena(const iarena)
{
	new ent = -1;
	switch (iarena)
	{
		case 1:
		{
			while ((ent = find_ent_by_class(ent, "ArenaA")))
			{
				remove_entity(ent);
			}
		}
		case 2:
		{
			while ((ent = find_ent_by_class(ent, "ArenaB")))
			{
				remove_entity(ent);
			}
		}
		case 3:
		{
			while ((ent = find_ent_by_class(ent, "ArenaC")))
			{
				remove_entity(ent);
			}
		}
		case 4:
		{
			while ((ent = find_ent_by_class(ent, "ArenaD")))
			{
				remove_entity(ent);
			}
		}
		case 5:
		{
			while ((ent = find_ent_by_class(ent, "ArenaE")))
			{
				remove_entity(ent);
			}
		}
		case 6:
		{
			while ((ent = find_ent_by_class(ent, "ArenaF")))
			{
				remove_entity(ent);
			}
		}
	}
}
client_printc(index, const text[], any:...)
{
    new szMsg[128];
    vformat(szMsg, sizeof(szMsg) - 1, text, 3);
    
    replace_all(szMsg, sizeof(szMsg) - 1, "!g", "^x04");
    replace_all(szMsg, sizeof(szMsg) - 1, "!n", "^x01");
    replace_all(szMsg, sizeof(szMsg) - 1, "!t", "^x03");
    
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index);
    write_byte(index);
    write_string(szMsg);
    message_end();
}
print_cc(id, fmt[], any:...)
{
	static saytext = 0, fake_user;
	if (!saytext)
	{
		saytext = get_user_msgid("SayText");
		fake_user = get_maxplayers() + 1;
	}
	new msg[192];
	vformat(msg, charsmax(msg), fmt, 3)
	replace_all(msg, sizeof(msg) - 1, "!g", "^x04");
	replace_all(msg, sizeof(msg) - 1, "!n", "^x01");
	replace_all(msg, sizeof(msg) - 1, "!t", "^x03");
	message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, saytext, _, id);
	write_byte(id ? id : fake_user);
	write_string(msg);
	message_end();
}
stock set_iAngle(index, Float:iAngle[3], Float:iOrigin[3])
{
	entity_set_vector(index, EV_VEC_angles, iAngle); 
	entity_set_int(index, EV_INT_fixangle, 1);
	set_user_origin(index, iOrigin);
	//entity_set_vector(index, EV_VEC_origin, iOrigin);
}
Линк към модела - https://dox.abv.bg/download?id=757127aab3

Ако това зависи от модела, бих дал модел, който е с по-голям дуел.
Ако зависи от координатите и координати имам.
Изображение

Потребителски аватар

Nikolow
AMXX Скриптър
AMXX Скриптър
Мнения: 176
Регистриран: 27 ное 2016, 13:02
Местоположение: Варна
Се отблагодари: 3 пъти
Получена благодарност: 53 пъти
Контакти:

Заявка за редактиране на плъгин [Knife Duels] - да се направят по-големи дуелите

Мнение от Nikolow » 13 мар 2019, 18:01

Тествай...
Default: knife_duel_respawn_delay "3.0"

Код: Избери всички

#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <cstrike>

new const INFO[3][] = 
{ 
	"Knife duels",
        "1.0",
        "Invisible" 
}
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif

new Float:vSizeMin[3], Float:vSizeMax[3], Float:vAngles[3];
new const gModel[] = "models/huehue_wall.mdl";
new const gCName[] = "info_target";
enum { X, Y, Z };
new bool:in_Duel[MAX_PLAYERS+1];
new g_Challenge[MAX_PLAYERS+1];
new g_Area[MAX_PLAYERS+1] = 0;
new g_DuelK[MAX_PLAYERS+1] = 0;
new g_DuelC[MAX_PLAYERS+1] = 0;
new g_MenuCallback;
new bool:Arena1in = false;
new bool:Arena2in = false;
new bool:Arena3in = false;
new bool:Arena4in = false;
new bool:Arena5in = false;
new bool:Arena6in = false;

new p_RespawnDelay;

public plugin_init() 
{
	register_plugin(INFO[0x00], INFO[0x01], INFO[0x02]);
	register_clcmd("say /kd","choose_playermenu");
	register_clcmd("say_team /kd","choose_playermenu");
	register_clcmd("say /knifeduel","choose_playermenu");
	register_clcmd("say_team /knifeduel","choose_playermenu");
	g_MenuCallback = menu_makecallback("menuitem_callback");
	RegisterHam(Ham_Touch, "weaponbox", "hamTouchWeapon");
	RegisterHam(Ham_Touch, "armoury_entity", "hamTouchWeapon");
	RegisterHam(Ham_Touch, "weapon_shield", "hamTouchWeapon");
	RegisterHam(Ham_TakeDamage, "player", "TakeDMG");
	RegisterHam(Ham_Killed, "player", "PlayerKilled");
	RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
	set_task(300.0, "Advert", _,_,_, "b");
	
	p_RespawnDelay = register_cvar("knife_duel_respawn_delay", "3.0")
}

public plugin_precache()
{
	precache_model(gModel);
}
public client_command(id)
{
        static const szJoinCommand[] = "jointeam";
	static const szJoinCommand1[] = "chooseteam";
        static szCommand[10];
        read_argv(0, szCommand, 9);
        if (equal(szCommand, szJoinCommand)
        && CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT)
        {
                return PLUGIN_HANDLED;
        }
	if (equal(szCommand, szJoinCommand1))
	{
		return PLUGIN_HANDLED;
	}
        return PLUGIN_CONTINUE;
}  
public Advert()
{
	print_cc(0, "!t[!gKnife Duels!t] By: !gInvisible!t.");
	print_cc(0, "!t[!gKnife Duels!t] Type !g/kd !tor !g/knifeduel !tto open the knife duel menu.");
}
public hamTouchWeapon(id)
{
	return 4;
}
public TakeDMG(victim, idinflictor, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
{
	if (victim != attacker)
	{
		if (in_Duel[victim] && !in_Duel[attacker])
		{
			return 4;
		}
	}
	return 1;
}
public PlayerKilled(victim, killer, shouldgib)
{
	if (is_user_alive(killer))
	{
		new victimname[32] , attackername[32];
		get_user_name(victim, victimname, 31);
		get_user_name(killer, attackername, 31);
		if (victim != killer && killer != 0 )
		{
			if (in_Duel[killer] && in_Duel[victim])
			{
				if (killer)
				{
					g_DuelK[killer]+=1;
				}
				if (g_Challenge[killer])
				{
					g_DuelC[g_Challenge[killer]]+=1;
				}
			}
		}
		if (in_Duel[killer] && in_Duel[victim])
		{
			if(g_DuelK[killer]<10 && g_DuelC[g_Challenge[killer]]<10)
			{
				if (!g_Challenge[victim])
				{
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", killer);
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", g_Challenge[victim]);
				}
				else
				{
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", g_Challenge[killer]);
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", victim);
				}
				client_printc(killer, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t.", attackername, g_DuelK[killer], g_DuelK[victim], victimname);
				client_printc(victim, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t.", victimname, g_DuelK[victim], g_DuelK[killer], attackername);
			}
			else
			{
				if (victim)
				{
					print_cc(0, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t. Winner - !g%s",
					attackername,
					g_DuelC[g_Challenge[killer]],
					g_DuelK[victim],
					victimname,
					attackername);
					DisableChecks(victim);
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", killer);
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", victim);
				}
				if (g_Challenge[victim])
				{
					print_cc(0, "!t[!gKnife Duels!t] !g%s (!t%i!g) !tvs. !g(!t%i!g) %s!t. Winner - !g%s",
					attackername,
					g_DuelK[killer],
					g_DuelC[g_Challenge[victim]],
					victimname,
					attackername);
					DisableChecks(g_Challenge[victim]);
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", killer);
					set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", victim);
				}
				g_DuelC[killer] = 0;
				g_DuelK[victim] = 0;
                                g_DuelC[victim] = 0;
				g_DuelK[killer] = 0;
			}
		}
	}
}
public PlayerSpawn(id)
{
	if (is_user_alive(id))
	{
		if (in_Duel[id])
		{
			whileinduel(id);
			set_user_health(g_Challenge[id], 35);
		}
	}
	if (is_user_alive(g_Challenge[id]))
	{
		if (in_Duel[g_Challenge[id]])
		{
			whileinduel(g_Challenge[id]);
			set_user_health(id, 35);
		}
	}
}
public whileinduel(id)
{
	switch (g_Area[id])
	{
		case 1:
		{
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{738, 327, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1207, 327, -360});
		}
		case 2:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{738, -2252, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1207, -2252, -360});
		}
		case 3:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{1368, 327, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1847, 327, -360});
		}
		case 4:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{88, -2252, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{566, -2252, -360});
		}
		case 5:
		{
			
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{88, 327, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{566, 327, -360});
		}
		case 6:
		{
			set_iAngle(id, Float:{0.0, 0.0, 0.0}, Float:{1368, -2252, -360});
			set_iAngle(g_Challenge[id], Float:{0.0, 180.0, 0.0}, Float:{1847, -2252, -360});
		}
	}
}
public GoToSpawn(killer) {ExecuteHamB(Ham_CS_RoundRespawn, killer);}
public DisableChecks(id)
{	
	if(in_Duel[id])
	{
		if (!g_Area[id])
		{
			switch (g_Area[g_Challenge[id]])
			{
				case 1:
				{
					Arena1in = false;
				}
				case 2:
				{
					Arena2in = false;
				}
				case 3:
				{
					Arena3in = false;
				}
				case 4:
				{
					Arena4in = false;
				}
				case 5:
				{
					Arena5in = false;
				}
				case 6:
				{
					Arena6in = false;
				}
			}
			dArena(g_Area[g_Challenge[id]]);
			g_Area[g_Challenge[id]] = 0;
		}
		else
		{
			switch (g_Area[id])
			{
				case 1:
				{
					Arena1in = false;
				}
				case 2:
				{
					Arena2in = false;
				}
				case 3:
				{
					Arena3in = false;
				}
				case 4:
				{
					Arena4in = false;
				}
				case 5:
				{
					Arena5in = false;
				}
				case 6:
				{
					Arena6in = false;
				}
			}
			dArena(g_Area[id]);	
			g_Area[id] = 0;
		}
		in_Duel[g_Challenge[id]] = false;
		in_Duel[id] = false;
	}
	if(g_Challenge[id])
	{
		g_Challenge[g_Challenge[id]] = 0;
		g_Challenge[id] = 0;
	}
}
public client_disconnected(id)
{
	new cname[32], ccname[32];
	get_user_name(g_Challenge[id], ccname, 31);
	get_user_name(g_Challenge[g_Challenge[id]], cname, 31);
	if (in_Duel[g_Challenge[id]])
	{
		set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", g_Challenge[id]);
		client_printc(g_Challenge[id], "!t[!gKnife Duels!t] !g%s !thas disconnected.", cname);
	}
	if (in_Duel[g_Challenge[g_Challenge[id]]])
	{
		set_task(get_pcvar_float(p_RespawnDelay), "GoToSpawn", g_Challenge[g_Challenge[id]]);
		client_printc(g_Challenge[g_Challenge[id]], "!t[!gKnife Duels!t] !g%s !thas disconnected.", ccname);
	}
	g_DuelC[g_Challenge[id]] = 0;
	g_DuelC[id] = 0;
	g_DuelK[g_Challenge[id]] = 0;
	g_DuelK[id] = 0;
	DisableChecks(id);
}
public choose_playermenu(Challenger, Challenged)
{
	if (!in_Duel[Challenger] && is_user_alive(Challenger))
	{
		if (Arena1in && Arena2in && Arena3in && Arena4in && Arena5in && Arena6in)
		{
			client_printc(Challenger, "!t[!gKnife Duels!t] All the knife duel arenas are in use.");
			return PLUGIN_HANDLED
		}
	}
	if (in_Duel[Challenger])
	{
		return PLUGIN_HANDLED
	}
	if (!is_user_alive(Challenger))
	{
		return PLUGIN_HANDLED
	}
	new menu = menu_create( "\y[\rKnife Duels\y]", "choose_playermenu_handler");
	menu_additem(menu, "\r[!]\yUpdate players\r[!]^n\yChallenge a player:", "0", 0);
	new players[32], pnum;
	new szName[32], szTempid[32], Desc[64];
	get_players(players, pnum);
	for (new i; i<pnum; i++)
	{
		Challenged = players[i];
		if (is_user_alive(Challenged) && (Challenger != Challenged))
		{
			get_user_name(Challenged, szName, charsmax(szName));
			formatex(Desc, charsmax(Desc), in_Duel[Challenged] ? "\d%s \y[\rIn duel\y]" : "%s", szName);
			num_to_str(Challenged, szTempid, charsmax(szTempid));
			menu_additem(menu, Desc, szTempid, 0, g_MenuCallback);
		}
	}
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(Challenger, menu, 0);
	return PLUGIN_HANDLED
}
public menuitem_callback(Challenger, menu, item)
{
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data, charsmax(data), szName,charsmax(szName), callback);
	new tempid = str_to_num(data);
	if (in_Duel[tempid] || !is_user_alive(tempid))
	{
		return ITEM_DISABLED;
	}
	return ITEM_ENABLED;
}
public choose_playermenu_handler(Challenger, menu, item)
{
	if (item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new data[6], szName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,charsmax(data), szName, charsmax(szName), callback);
	new tempid = str_to_num(data);
	switch(item)
    	{
        	case 0:
        	{
			choose_playermenu(Challenger, Challenger);
		}
	}
	if (is_user_alive(tempid) && !in_Duel[tempid])
	{
		g_Challenge[Challenger] = tempid;
		g_Challenge[tempid] = Challenger;
		Questionm(tempid);
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public Questionm(Challenged) 
{
	if (is_user_alive(Challenged) && is_user_alive(g_Challenge[Challenged]))
	{
		new szAddItemText[555 char], ChallengerName[32];
		get_user_name(g_Challenge[Challenged], ChallengerName, 31);
		format(szAddItemText, charsmax(szAddItemText), "\y[\rKnife Duels\y]^n\wKnife duel vs. \r%s\w?", ChallengerName);
		new menu = menu_create(szAddItemText, "Questionm_handler")
		menu_additem(menu, "\yYes", "1", 0);
		menu_additem(menu, "\rNo", "2", 0);
		menu_setprop(menu, MPROP_PERPAGE, 0);
		menu_display(Challenged, menu, 0);
		return PLUGIN_HANDLED
	}
	/*else 
	{ 
		return PLUGIN_HANDLED 
	}*/
	return PLUGIN_HANDLED
}
public Questionm_handler(Challenged, menu, item)
{	
	new data[6], szName[64], ccname[32], cname[32];
	new access, callback;
	menu_item_getinfo(menu, item, access, data, charsmax(data), szName, charsmax(szName), callback);
	new key = str_to_num(data);
	get_user_name(Challenged, ccname, 31);
	get_user_name(g_Challenge[Challenged], cname, 31);
	switch(key)
	{
		case 1:
		{
			if (in_Duel[g_Challenge[Challenged]])
			{
				if (task_exists(Challenged))
				{
					menu_destroy(menu);
					remove_task(Challenged);
				}
				client_printc(Challenged, "!t[!gKnife Duels!t] !gYou !twere late, !g%s !tis in duel right now.", cname);
				DisableChecks(Challenged);
				return PLUGIN_HANDLED
			}
			if (!is_user_alive(Challenged))
			{
				if (task_exists(Challenged))
				{
					menu_destroy(menu);
					remove_task(Challenged);
				}
				client_printc(Challenged, "!t[!gKnife Duels!t] !gYou !tare !gdead!t.", ccname);
				DisableChecks(Challenged);
				return PLUGIN_HANDLED
			}
			if (!is_user_alive(g_Challenge[Challenged]))
			{
				if (task_exists(Challenged))
				{
					menu_destroy(menu);
					remove_task(Challenged);
				}
				client_printc(Challenged, "!t[!gKnife Duels!t] !g%s !thas !gdied/disconnected!t.", cname);
				DisableChecks(Challenged);
				return PLUGIN_HANDLED
			}
			if (task_exists(Challenged))
			{
				menu_destroy(menu);
				remove_task(Challenged);
			}
			if (!g_Challenge[Challenged])
			{
				menu_destroy(menu);
				return PLUGIN_HANDLED
			}
			else
			{
				choose_area(Challenged);
				client_printc(g_Challenge[Challenged], "!t[!gKnife Duels!t] !g%s !taccepted the duel.", ccname);
				in_Duel[Challenged] = true;
				in_Duel[g_Challenge[Challenged]] = true;
			}
			return PLUGIN_HANDLED
		}
		case 2:
		{
			if (task_exists(Challenged))
			{
				menu_destroy(menu);
				remove_task(Challenged);
			}
			client_printc(g_Challenge[Challenged], "!t[!gKnife Duels!t] !g%s !trefused the duel.", ccname);
			DisableChecks(Challenged);
			return PLUGIN_HANDLED
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED
}

public choose_area(Challenged)
{
	if (cs_get_user_team(g_Challenge[Challenged]) == cs_get_user_team(Challenged))
	{
    		switch (cs_get_user_team(g_Challenge[Challenged]))
		{
        		case (CS_TEAM_CT):
			{
				cs_set_user_team(Challenged, CS_TEAM_T, CS_T_LEET);
        		}
        		case (CS_TEAM_T):
			{
				cs_set_user_team(Challenged, CS_TEAM_CT, CS_CT_GIGN);
       			}
    		}
	}
	g_Area[Challenged] = 1;
	switch (g_Area[Challenged])
	{
		case 1:
		{
			if (Arena1in) { g_Area[Challenged]+=1; }
			switch (g_Area[Challenged])
			{
				case 2:
				{
					if (Arena2in) { g_Area[Challenged]+=1; }
					switch (g_Area[Challenged])
					{
						case 3:
						{
							if (Arena3in) { g_Area[Challenged]+=1; }
							switch (g_Area[Challenged])
							{
								case 4:
								{
									if (Arena4in) { g_Area[Challenged]+=1; }
									switch (g_Area[Challenged])
									{
										case 5:
										{
											if (Arena5in) { g_Area[Challenged]+=1; }
											switch (g_Area[Challenged])
											{
												case 6:
												{
													if (Arena6in)
													{
														new cccname[32];
														get_user_name(Challenged, cccname, 31);
														client_printc(Challenged, "!t[!gKnife Duels!t] All the knife duel arenas are in use, you were too late.");
														client_printc(g_Challenge[Challenged], "!t[!gKnife Duels!t] All the knife duel arenas are in use, !g%s !twas too late with his/her decision", cccname);
														DisableChecks(Challenged);
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
	startduel(Challenged);
}

public startduel(Challenged)
{
	if (task_exists(Challenged))
	{
		remove_task(Challenged);
	}
	set_user_health(Challenged, 35);
	set_user_health(g_Challenge[Challenged], 35);
   	set_user_armor(Challenged, 0);
	set_user_armor(g_Challenge[Challenged], 0);
	strip_user_weapons(Challenged);
	strip_user_weapons(g_Challenge[Challenged]);
	give_item(Challenged, "weapon_knife");
	give_item(g_Challenge[Challenged], "weapon_knife");
	set_user_maxspeed(Challenged, 250.0);
	set_user_maxspeed(g_Challenge[Challenged], 250.0);
	set_user_gravity(Challenged, 1.0);
	set_user_gravity(g_Challenge[Challenged], 1.0);
	switch (g_Area[Challenged])
	{
		case 1:
		{
			Arena1in = true; 
			Arena1();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{738, 327, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1207, 327, -360});
		}
		case 2:
		{
			Arena2in = true; 
			Arena2();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{738, -2252, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1207, -2252, -360});
		}
		case 3:
		{
			Arena3in = true; 
			Arena3();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{1368, 327, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1847, 327, -360});
		}
		case 4:
		{
			Arena4in = true; 
			Arena4();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{88, -2252, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{566, -2252, -360});
		}
		case 5:
		{
			Arena5in = true; 
			Arena5();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{88, 327, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{566, 327, -360});
		}
		case 6:
		{
			Arena6in = true; 	
			Arena6();
			set_iAngle(Challenged, Float:{0.0, 0.0, 0.0}, Float:{1368, -2252, -360});
			set_iAngle(g_Challenge[Challenged], Float:{0.0, 180.0, 0.0}, Float:{1847, -2252, -360});
		}
	}
	return PLUGIN_HANDLED
}


public Arena1()
{
	createBlock(Float:{775.065368, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{775.065368, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{775.065368, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{903.065368, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{903.065368, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{903.065368, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{1031.065429, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{1031.065429, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{1031.065429, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{1159.065429, 327.047912, -401.000000}, Z, 1);
	createBlock(Float:{1159.065429, 455.047912, -401.000000}, Z, 1);
	createBlock(Float:{1159.065429, 199.047912, -401.000000}, Z, 1);
	createBlock(Float:{775.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{903.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{1031.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{1159.254150, 131.397644, -333.000000}, Y, 1);
	createBlock(Float:{708.103942, 454.809265, -334.000000}, X, 1);
	createBlock(Float:{708.103942, 326.809265, -334.000000}, X, 1);
	createBlock(Float:{708.103942, 198.809265, -334.000000}, X, 1);
	createBlock(Float:{1227.110351, 455.312744, -333.000000}, X, 1);
	createBlock(Float:{1227.110351, 327.312744, -333.000000}, X, 1);
	createBlock(Float:{1227.110351, 199.312744, -333.000000}, X, 1);
}
public Arena2()
{
	createBlock(Float:{775.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{775.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{775.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{903.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{903.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{903.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{1031.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{1031.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{1031.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{1159.480957, -2121.705566, -401.000000}, Z, 2);
	createBlock(Float:{1159.480957, -2249.705566, -401.000000}, Z, 2);
	createBlock(Float:{1159.480957, -2377.705566, -401.000000}, Z, 2);
	createBlock(Float:{775.384826, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{903.384826, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{1031.384765, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{1159.384765, -2055.561279, -334.000000}, Y, 2);
	createBlock(Float:{707.239074, -2250.012207, -333.000000}, X, 2);
	createBlock(Float:{707.239074, -2122.012207, -333.000000}, X, 2);
	createBlock(Float:{707.239074, -2378.012207, -333.000000}, X, 2);
	createBlock(Float:{1227.693481, -2120.965332, -333.000000}, X, 2);
	createBlock(Float:{1227.693481, -2248.965332, -333.000000}, X, 2);
	createBlock(Float:{1227.693481, -2376.965332, -333.000000}, X, 2);	
}
public Arena3()
{
	createBlock(Float:{1415.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1415.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1415.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1543.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1543.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1543.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1671.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1671.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1671.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1799.065429, 455.047912, -401.000000}, Z, 3);
	createBlock(Float:{1799.065429, 327.047912, -401.000000}, Z, 3);
	createBlock(Float:{1799.065429, 199.047912, -401.000000}, Z, 3);
	createBlock(Float:{1415.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1543.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1671.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1799.254150, 131.397644, -333.000000}, Y, 3);
	createBlock(Float:{1347.110351, 455.312744, -333.000000}, X, 3);
	createBlock(Float:{1347.110351, 199.312744, -333.000000}, X, 3);
	createBlock(Float:{1347.110351, 327.312744, -333.000000}, X, 3);
	createBlock(Float:{1867.993286, 199.052581, -334.000000}, X, 3);
	createBlock(Float:{1867.993286, 327.052581, -334.000000}, X, 3);
	createBlock(Float:{1867.993286, 455.052581, -334.000000}, X, 3);	
}
public Arena4()
{
	createBlock(Float:{135.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{135.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{135.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{263.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{263.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{263.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{391.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{391.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{391.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{519.480957, -2121.705566, -401.000000}, Z, 4);
	createBlock(Float:{519.480957, -2249.705566, -401.000000}, Z, 4);
	createBlock(Float:{519.480957, -2377.705566, -401.000000}, Z, 4);
	createBlock(Float:{135.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{263.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{391.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{519.384826, -2055.561279, -334.000000}, Y, 4);
	createBlock(Float:{67.456420, -2122.505859, -334.000000}, X, 4);
	createBlock(Float:{67.456420, -2250.505859, -334.000000}, X, 4);
	createBlock(Float:{67.456420, -2378.505859, -334.000000}, X, 4);
	createBlock(Float:{587.239074, -2122.012207, -333.000000}, X, 4);
	createBlock(Float:{587.239074, -2250.012207, -333.000000}, X, 4);
	createBlock(Float:{587.239074, -2378.012207, -333.000000}, X, 4);
}
public Arena5()
{
	createBlock(Float:{135.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{135.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{135.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{263.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{263.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{263.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{391.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{391.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{391.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{519.065368, 327.047912, -401.000000}, Z, 5);
	createBlock(Float:{519.065368, 199.047912, -401.000000}, Z, 5);
	createBlock(Float:{519.065368, 455.047912, -401.000000}, Z, 5);
	createBlock(Float:{135.254165, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{263.254150, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{391.254150, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{519.254150, 131.397644, -333.000000}, Y, 5);
	createBlock(Float:{68.532188, 326.920654, -333.000000}, X, 5);
	createBlock(Float:{68.532188, 198.920654, -333.000000}, X, 5);
	createBlock(Float:{68.532188, 454.920654, -333.000000}, X, 5);
	createBlock(Float:{586.069213, 327.133148, -334.000000}, X, 5);
	createBlock(Float:{586.069213, 199.133148, -334.000000}, X, 5);
	createBlock(Float:{586.069213, 455.133148, -334.000000}, X, 5);	
}
public Arena6()
{
	createBlock(Float:{1415.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1415.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1415.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1543.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1543.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1543.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1671.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1671.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1671.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1799.480957, -2121.705566, -401.000000}, Z, 6);
	createBlock(Float:{1799.480957, -2249.705566, -401.000000}, Z, 6);
	createBlock(Float:{1799.480957, -2377.705566, -401.000000}, Z, 6);
	createBlock(Float:{1415.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1543.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1671.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1799.384765, -2055.561279, -334.000000}, Y, 6);
	createBlock(Float:{1348.344604, -2377.144531, -333.000000}, X, 6);
	createBlock(Float:{1348.344604, -2249.144531, -333.000000}, X, 6);
	createBlock(Float:{1348.344604, -2121.144531, -333.000000}, X, 6);
	createBlock(Float:{1867.397583, -2377.233154, -333.000000}, X, 6);
	createBlock(Float:{1867.397583, -2249.233154, -333.000000}, X, 6);
	createBlock(Float:{1867.397583, -2121.233154, -333.000000}, X, 6);
}

/* Do not touch this values ! */
#define SIZE_P64 64.0
#define SIZE_N64 -64.0
#define SIZE_P4 4.0
#define SIZE_N4 -4.0 
#define SPECIFIC_ANGLE 0.0 /* 90.0 */

stock bool:createBlock(Float:vOrigin[3], const blocktype, const aclass)
{ 
   	new ent = create_entity(gCName);
   	if (is_valid_ent(ent)) 
   	{
		switch (aclass)
		{
			case 1:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaA");
			}
			case 2:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaB");
			}
			case 3:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaC");
			}
			case 4:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaD");
			}
			case 5:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaE");
			}
			case 6:
			{
				entity_set_string(ent, EV_SZ_classname, "ArenaF");
			}
		}

		entity_set_int(ent, EV_INT_solid, SOLID_BBOX); 
		entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE); 
		entity_set_model(ent, gModel);

		switch (blocktype)
		{
			//walls 2 ( - ) SIDES
			case X:
			{
				vSizeMin[0] = SIZE_N4; vSizeMin[1] = SIZE_N64; vSizeMin[2] = SIZE_N64;
				vSizeMax[0] = SIZE_P4; vSizeMax[1] = SIZE_P64; vSizeMax[2] = SIZE_P64;
				vAngles[0] = 90.0; vAngles[1] = 0.0; vAngles[2] = 0.0;
				set_rendering(ent, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
			}
			//walls 1 ( | ) from base to base
			case Y:
			{
				vSizeMin[0] = SIZE_N64; vSizeMin[1] = SIZE_N4; vSizeMin[2] = SIZE_N64;
				vSizeMax[0] = SIZE_P64; vSizeMax[1] = SIZE_P4; vSizeMax[2] = SIZE_P64;
				vAngles[0] = 90.0; vAngles[1] = 0.0; vAngles[2] = 90.0;
				set_rendering(ent, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0);
			}
			//bottom, top
			case Z:
			{
				vSizeMin[0] = SIZE_N64; vSizeMin[1] = SIZE_N64; vSizeMin[2] = SIZE_N4;
				vSizeMax[0] = SIZE_P64; vSizeMax[1] = SIZE_P64; vSizeMax[2] = SIZE_P4;
				vAngles[0] = SPECIFIC_ANGLE; vAngles[1] = 0.0; vAngles[2] = 0.0;
			}
		}

		entity_set_vector(ent, EV_VEC_angles, vAngles);
		entity_set_size(ent, vSizeMin, vSizeMax);
		entity_set_origin(ent, vOrigin);

		return true; 
   	}
	return false; 
}
stock dArena(const iarena)
{
	new ent = -1;
	switch (iarena)
	{
		case 1:
		{
			while ((ent = find_ent_by_class(ent, "ArenaA")))
			{
				remove_entity(ent);
			}
		}
		case 2:
		{
			while ((ent = find_ent_by_class(ent, "ArenaB")))
			{
				remove_entity(ent);
			}
		}
		case 3:
		{
			while ((ent = find_ent_by_class(ent, "ArenaC")))
			{
				remove_entity(ent);
			}
		}
		case 4:
		{
			while ((ent = find_ent_by_class(ent, "ArenaD")))
			{
				remove_entity(ent);
			}
		}
		case 5:
		{
			while ((ent = find_ent_by_class(ent, "ArenaE")))
			{
				remove_entity(ent);
			}
		}
		case 6:
		{
			while ((ent = find_ent_by_class(ent, "ArenaF")))
			{
				remove_entity(ent);
			}
		}
	}
}
client_printc(index, const text[], any:...)
{
    new szMsg[128];
    vformat(szMsg, sizeof(szMsg) - 1, text, 3);
    
    replace_all(szMsg, sizeof(szMsg) - 1, "!g", "^x04");
    replace_all(szMsg, sizeof(szMsg) - 1, "!n", "^x01");
    replace_all(szMsg, sizeof(szMsg) - 1, "!t", "^x03");
    
    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, index);
    write_byte(index);
    write_string(szMsg);
    message_end();
}
print_cc(id, fmt[], any:...)
{
	static saytext = 0, fake_user;
	if (!saytext)
	{
		saytext = get_user_msgid("SayText");
		fake_user = get_maxplayers() + 1;
	}
	new msg[192];
	vformat(msg, charsmax(msg), fmt, 3)
	replace_all(msg, sizeof(msg) - 1, "!g", "^x04");
	replace_all(msg, sizeof(msg) - 1, "!n", "^x01");
	replace_all(msg, sizeof(msg) - 1, "!t", "^x03");
	message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, saytext, _, id);
	write_byte(id ? id : fake_user);
	write_string(msg);
	message_end();
}
stock set_iAngle(index, Float:iAngle[3], Float:iOrigin[3])
{
	entity_set_vector(index, EV_VEC_angles, iAngle); 
	entity_set_int(index, EV_INT_fixangle, 1);
	set_user_origin(index, iOrigin);
	//entity_set_vector(index, EV_VEC_origin, iOrigin);
}
Tired and retired...

Потребителски аватар

Автор на темата
summertime vibes PSA
Тестов модератор
Тестов модератор
Мнения: 951
Регистриран: 27 ное 2016, 17:47
Местоположение: In the Heaven
Се отблагодари: 39 пъти
Получена благодарност: 74 пъти
Контакти:

Заявка за редактиране на плъгин [Knife Duels] - да се направят по-големи дуелите

Мнение от summertime vibes PSA » 13 мар 2019, 18:23

Добре е, но не може ли дуела да се направи по-голям както казах, защото е прекалено малък..
Изображение

Потребителски аватар

Nikolow
AMXX Скриптър
AMXX Скриптър
Мнения: 176
Регистриран: 27 ное 2016, 13:02
Местоположение: Варна
Се отблагодари: 3 пъти
Получена благодарност: 53 пъти
Контакти:

Заявка за редактиране на плъгин [Knife Duels] - да се направят по-големи дуелите

Мнение от Nikolow » 13 мар 2019, 23:56

summertime vibes написа:
13 мар 2019, 18:23
Добре е, но не може ли дуела да се направи по-голям както казах, защото е прекалено малък..
Какво ще рече по-голям? За площ ли говорим?
Tired and retired...

Потребителски аватар

Автор на темата
summertime vibes PSA
Тестов модератор
Тестов модератор
Мнения: 951
Регистриран: 27 ное 2016, 17:47
Местоположение: In the Heaven
Се отблагодари: 39 пъти
Получена благодарност: 74 пъти
Контакти:

Заявка за редактиране на плъгин [Knife Duels] - да се направят по-големи дуелите

Мнение от summertime vibes PSA » 17 мар 2019, 17:10

Ами за самият дуел по големина и широчина. Да, за площ, видях че всичко е с координати в плъгина, ако искате ще ви ги дам, ако съответно зависи от това големината на дуела. Незнайно защо като някой ми прати дуел и изчакам малко и приема (със закъснение) след 1 секунда сървъра крашва.


Последно избутана от summertime vibes на 17 мар 2019, 17:10.
Изображение

Отговори

Върни се в “Заявки за плъгини”

Кой е на линия

Потребители, разглеждащи този форум: Няма регистрирани потребители и 3 госта