[CS 1.6 / CS:CZ] Zombie Plague Enterprise

Ecklory
Site Admin
Posts: 52

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#51 » Sun Feb 10, 2019 6:27 am

Есть ещё некоторый момент.
Те нативы, с которыми вы сейчас работаете оптимизировать не имеет смысла, тк мы уже их оптимизировали.
https://git.ckcorp.ru/ck/amxx-modes/zpe ... is.inc#L18

Можно ещё накинуть оптимизаций, в упор, но тогда к коду добавится тысяча-другая строк (на весь ZPE).

pach2580
Posts: 48

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#52 » Sun Feb 10, 2019 9:05 am

Суть в том, что я делал эти классы году в 2015, я создал эти массивы, потому что не мог определиться какой мод использовать zp4.3 либо, zp 5.0.8, а теперь вообще использую вами разработанный мод ZPE

GTR
Posts: 2

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#53 » Sun Feb 10, 2019 10:07 am

Когда ждать stable версию?

Ecklory
Site Admin
Posts: 52

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#54 » Sun Feb 10, 2019 10:12 am

Code: Select all

Когда ждать stable версию?
Сложно сказать... Главный разработчик появляется редко, а патчи рассматривает только он и конечное решение за ним.

GTR
Posts: 2

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#55 » Sun Feb 10, 2019 11:04 am

За все время существования мода stable еще не было?)

Ecklory
Site Admin
Posts: 52

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#56 » Sun Feb 10, 2019 12:16 pm

Стабильная версия была, но когда постоянно идут какие-то изменения... Да и стабильность можно понимать по разному.

pach2580
Posts: 48

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#57 » Sun Feb 10, 2019 2:00 pm

Spoiler
Show

Code: Select all

#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <zpe_kernel>
#include <zpe_class_zombie>
#define LIBRARY_SURVIVOR "zpe_class_survivor"
#include <zpe_class_survivor>
#include <zpe_class_sniper>
#include <zpe_class_nemesis>

/*native //give_weapon_hk416(iPlayer)
native //give_weapon_scar(iPlayer)
native //give_weapon_fnc(iPlayer)
native //give_weapon_cartblue(iPlayer)
native //give_weapon_m14ebr(iPlayer)
native //give_weapon_guitar(iPlayer)
native //give_weapon_vsk94(iPlayer)
native //give_weapon_xm8(iPlayer)
native //give_weapon_f2000(iPlayer)
native //give_weapon_m1887(iPlayer)
native //give_weapon_dbarrel(iPlayer)
native //give_weapon_gthompson(iPlayer)
native //give_weapon_dmp7a1(iPlayer)
native //give_weapon_anaconda(iPlayer)
native //give_weapon_dinfinity(iPlayer)
native //give_weapon_infinityss(iPlayer)
native zp_knife_menus_show(iPlayer)*/

#define zombie(%0)		zpe_core_is_zombie(%0)
#define nemesis(%0)		zpe_class_nemesis_get(%0)
#define survivor(%0)	zpe_class_survivor_get(%0)

#define get_money(%0)		CS_GET_USER_MONEY(%0)
#define set_money(%0,%1)	CS_SET_USER_MONEY(%0,%1)

new g_Can_Buy_Primary, g_Can_Buy_Secondary;
new Float:g_fBuy_Time_Start[33]

#define m_iMenu 205

new g_iBit_Alive;

public plugin_init() {
	register_clcmd("say /buy", "Client_Command_Buy")
	register_clcmd("say buy", "Client_Command_Buy")
	register_clcmd("say /guns", "Client_Command_Buy")
	register_clcmd("say guns", "Client_Command_Buy")
	register_clcmd("/guns", "Client_Command_Buy")
	register_clcmd("guns", "Client_Command_Buy")
}

public Client_Command_Buy(iPlayer)
{
	// Player dead or zombie
	if (BIT_NOT_VALID(g_iBit_Alive, iPlayer) || zombie(iPlayer))
	{
		return;
	}
	
	Show_Available_Buy_Menus(iPlayer)
}

public zpe_fw_core_cure_post(iPlayer, attacker)
{
	// Buyzone time starts when player is set to human
	g_fBuy_Time_Start[iPlayer] = get_gametime();

	Human_Weapons(iPlayer);
}

public Human_Weapons(iPlayer)
{
	// Player dead or zombie
	if (BIT_NOT_VALID(g_iBit_Alive, iPlayer) || zpe_core_is_zombie(iPlayer))
	{
		return;
	}
	
	// Survivor and Sniper automatically gets his own weapon
	if (zpe_class_survivor_get(iPlayer) || zpe_class_sniper_get(iPlayer))
	{
		BIT_SUB(g_Can_Buy_Primary, iPlayer);
		BIT_SUB(g_Can_Buy_Secondary, iPlayer);

		return;
	}
	
	BIT_ADD(g_Can_Buy_Primary, iPlayer);
	BIT_ADD(g_Can_Buy_Secondary, iPlayer);
	
	// Open available buy menus
	Show_Available_Buy_Menus(iPlayer);
}

public Show_Available_Buy_Menus(iPlayer)
{
	if (BIT_VALID(g_Can_Buy_Primary, iPlayer)) {
		Show_Menu_Buy_Primary(iPlayer)
	} else if (BIT_VALID(g_Can_Buy_Secondary, iPlayer)) {
		Show_Menu_Buy_Secondary(iPlayer)
	}
}

public Show_Menu_Buy_Primary(iPlayer) {
	new g_Menu_Weapon_Primary = menu_create("Главное оружие:", "Menu_Buy_Primary");
	
	menu_additem(g_Menu_Weapon_Primary, "IMI Galil", "1");
	menu_additem(g_Menu_Weapon_Primary, "Famas", "2");
	menu_additem(g_Menu_Weapon_Primary, "M4A1 Carbine", "3");
	menu_additem(g_Menu_Weapon_Primary, "AK-47 Kalashnikov", "4");
	menu_additem(g_Menu_Weapon_Primary, "H&K HK416 - \y3100$", "5");
	menu_additem(g_Menu_Weapon_Primary, "FN Scar - \y3250$", "6");
	menu_additem(g_Menu_Weapon_Primary, "FN FNC - \y2100$", "7");
	menu_additem(g_Menu_Weapon_Primary, "Cart Blue - \y4000$", "8");
	menu_additem(g_Menu_Weapon_Primary, "M14 - \y3400$", "9");
	menu_additem(g_Menu_Weapon_Primary, "Guitar - \y3100$", "10");
	menu_additem(g_Menu_Weapon_Primary, "SG-552 Commando", "11");
	menu_additem(g_Menu_Weapon_Primary, "Steyr Aug A1", "12");
	menu_additem(g_Menu_Weapon_Primary, "VSK94 - \y3750$", "13");
	menu_additem(g_Menu_Weapon_Primary, "H&K XM8 - \y3250$", "14");
	menu_additem(g_Menu_Weapon_Primary, "FN F2000 - \y3600$", "15");
	menu_additem(g_Menu_Weapon_Primary, "Schmidt Scout", "16");
	menu_additem(g_Menu_Weapon_Primary, "M3 Super 90", "17");
	menu_additem(g_Menu_Weapon_Primary, "XM1014 M4", "18");
	menu_additem(g_Menu_Weapon_Primary, "Winchester M1887 - \y2800$", "19");
	menu_additem(g_Menu_Weapon_Primary, "Double Barrel Sawn-Off - \y2600$", "20");
	menu_additem(g_Menu_Weapon_Primary, "Gold Thompson - \y2000$", "21");
	menu_additem(g_Menu_Weapon_Primary, "Schmidt TMP", "22");
	menu_additem(g_Menu_Weapon_Primary, "Ingram MAC-10", "23");
	menu_additem(g_Menu_Weapon_Primary, "H&K MP5 Navy", "24");
	menu_additem(g_Menu_Weapon_Primary, "H&K Double MP7A1 - \y4650$", "25");
	menu_additem(g_Menu_Weapon_Primary, "UMP 45", "26");
	menu_additem(g_Menu_Weapon_Primary, "ES P90", "27");
	
	menu_setprop(g_Menu_Weapon_Primary, MPROP_NEXTNAME, "Вперед")
	menu_setprop(g_Menu_Weapon_Primary, MPROP_BACKNAME, "Назад")
	menu_setprop(g_Menu_Weapon_Primary, MPROP_EXITNAME, "Выход")
	
	//set_pdata_int(iPlayer, m_iMenu, 0, 5);
	menu_display(iPlayer, g_Menu_Weapon_Primary, 0);
	return PLUGIN_HANDLED;
}

public Show_Menu_Buy_Secondary(iPlayer) {
	new g_MWS = menu_create("Доп. оружие:", "Menu_Buy_Secondary");
	
	menu_additem(g_MWS, "P228 Compact", "1");
	menu_additem(g_MWS, "Desert Eagle .50 AE", "2");
	menu_additem(g_MWS, "FiveseveN", "3");
	menu_additem(g_MWS, "Dual Elite Berettas", "4");
	menu_additem(g_MWS, "Colt Anaconda - \y600$", "5");
	menu_additem(g_MWS, "Dual SVI Infinity - \y1500$", "6");
	menu_additem(g_MWS, "Single Infinity SS - \y600$", "7");
	
	menu_setprop(g_MWS, MPROP_NEXTNAME, "Вперед")
	menu_setprop(g_MWS, MPROP_BACKNAME, "Назад")
	menu_setprop(g_MWS, MPROP_EXITNAME, "Выход")
	
	set_pdata_int(iPlayer, m_iMenu, 0, 5);
	menu_display(iPlayer, g_MWS, 0);
	return PLUGIN_HANDLED;
}

public Menu_Buy_Primary(iPlayer, iMenu, iKey) {
	if(iKey == MENU_EXIT) {
		menu_destroy(iMenu);
		return;
	}
	
	// Player dead or zombie or already bought primary
	if (BIT_NOT_VALID(g_iBit_Alive, iPlayer) || zpe_core_is_zombie(iPlayer) || BIT_NOT_VALID(g_Can_Buy_Primary, iPlayer))
	{
		show_menu(iPlayer, 0, "^n", 1);
		return;
	}
	
	/*if(floatround(g_fBuy_Time_Start[iPlayer] + get_cvar_float("zp_buy_custom_time") - get_gametime()) <= 0)
	{
		client_print(iPlayer, print_center, "Время покупок истекло")
		show_menu(iPlayer, 0, "^n", 1);
		return;
	}*/
	
	switch(iKey) {
		case 0: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_galil")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "556nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 1: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_famas")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "556nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 2: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_m4a1")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "556nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 3: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_ak47")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "762nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 4: {
			if(get_money(iPlayer) >= 3100) {
				//give_weapon_hk416(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3100)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 5: {
			if(get_money(iPlayer) >= 3250) {
				//give_weapon_scar(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3250)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 6: {
			if(get_money(iPlayer) >= 2100) {
				//give_weapon_fnc(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 2100)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 7: {
			if(get_money(iPlayer) >= 4000) {
				//give_weapon_cartblue(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 4000)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 8: {
			if(get_money(iPlayer) >= 3400) {
				//give_weapon_m14ebr(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3400)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 9: {
			if(get_money(iPlayer) >= 3100) {
				//give_weapon_guitar(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3100)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 10: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_aug")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "556nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 11: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_sg552")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "556nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 12: {
			if(get_money(iPlayer) >= 3750) {
				//give_weapon_vsk94(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3750)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 13: {
			if(get_money(iPlayer) >= 3250) {
				//give_weapon_xm8(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3250)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 14: {
			if(get_money(iPlayer) >= 3600) {
				//give_weapon_f2000(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 3600)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 15: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_scout")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 90, "762nato", 90)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 16: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_m3")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 32, "buckshot", 32)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 17: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_xm1014")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 32, "buckshot", 32)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 18: {
			if(get_money(iPlayer) >= 2800) {
				//give_weapon_m1887(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 2800)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 19: {
			if(get_money(iPlayer) >= 2600) {
				//give_weapon_dbarrel(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 2600)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 20: {
			if(get_money(iPlayer) >= 2000) {
				//give_weapon_gthompson(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 2000)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 21: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_tmp")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 120, "9mm", 120)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 22: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_mac10")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 100, "45acp", 100)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 23: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_mp5navy")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 120, "9mm", 120)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 24: {
			if(get_money(iPlayer) >= 4650) {
				//give_weapon_dmp7a1(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 4650)
				BIT_SUB(g_Can_Buy_Primary, iPlayer);
			}
		} case 25: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_ump45")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 100, "45acp", 100)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		} case 26: {
			Player_DropWeapons(iPlayer, 1)
			fm_give_item(iPlayer, "weapon_p90")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 100, "57mm", 100)
			BIT_SUB(g_Can_Buy_Primary, iPlayer);
		}
	}
	Show_Available_Buy_Menus(iPlayer)
}

public Menu_Buy_Secondary(iPlayer, iMenu, iKey) {
	if(iKey == MENU_EXIT) {
		show_menu(iPlayer, 0, "^n", 1);
		return;
	}
	
	// Player dead or zombie or already bought primary
	if (BIT_NOT_VALID(g_iBit_Alive, iPlayer) || zpe_core_is_zombie(iPlayer) || BIT_NOT_VALID(g_Can_Buy_Secondary, iPlayer))
	{
		show_menu(iPlayer, 0, "^n", 1);
		return;
	}
	
	/*if(floatround(g_fBuy_Time_Start[iPlayer] + get_cvar_float("zp_buy_custom_time") - get_gametime()) <= 0) {
		client_print(iPlayer, print_center, "Время покупок истекло")
		show_menu(iPlayer, 0, "^n", 1);
		return;
	}*/
	
	switch(iKey) {
		case 0: {
			//zp_knife_menus_show(iPlayer)
			Player_DropWeapons(iPlayer, 2)
			fm_give_item(iPlayer, "weapon_p228")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 52, "357sig", 52)
			fm_give_item(iPlayer, "weapon_hegrenade")
			fm_give_item(iPlayer, "weapon_flashbang")
			fm_give_item(iPlayer, "weapon_smokegrenade")
			BIT_SUB(g_Can_Buy_Secondary, iPlayer);
		} case 1: {
			//zp_knife_menus_show(iPlayer)
			Player_DropWeapons(iPlayer, 2)
			fm_give_item(iPlayer, "weapon_deagle")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 35, "50ae", 35)
			fm_give_item(iPlayer, "weapon_hegrenade")
			fm_give_item(iPlayer, "weapon_flashbang")
			fm_give_item(iPlayer, "weapon_smokegrenade")
			BIT_SUB(g_Can_Buy_Secondary, iPlayer);
		} case 2: {
			//zp_knife_menus_show(iPlayer)
			Player_DropWeapons(iPlayer, 2)
			fm_give_item(iPlayer, "weapon_fiveseven")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 100, "57mm", 100)
			fm_give_item(iPlayer, "weapon_hegrenade")
			fm_give_item(iPlayer, "weapon_flashbang")
			fm_give_item(iPlayer, "weapon_smokegrenade")
			BIT_SUB(g_Can_Buy_Secondary, iPlayer);
		} case 3: {
			//zp_knife_menus_show(iPlayer)
			Player_DropWeapons(iPlayer, 2)
			fm_give_item(iPlayer, "weapon_elite")
			ExecuteHamB(Ham_GiveAmmo, iPlayer, 120, "9mm", 120)
			fm_give_item(iPlayer, "weapon_hegrenade")
			fm_give_item(iPlayer, "weapon_flashbang")
			fm_give_item(iPlayer, "weapon_smokegrenade")
			BIT_SUB(g_Can_Buy_Secondary, iPlayer);
		} case 4: {
			if(get_money(iPlayer) >= 600) {
				//zp_knife_menus_show(iPlayer)
				//give_weapon_anaconda(iPlayer)
				set_money(iPlayer, get_money(iPlayer) - 600)
				fm_give_item(iPlayer, "weapon_hegrenade")
				fm_give_item(iPlayer, "weapon_flashbang")
				fm_give_item(iPlayer, "weapon_smokegrenade")
				BIT_SUB(g_Can_Buy_Secondary, iPlayer);
			}
		} case 5: {
			if(get_money(iPlayer) >= 1500) {
				//zp_knife_menus_show(iPlayer)
				//give_weapon_dinfinity(iPlayer)
				set_money(iPlayer, get_money(iPlayer) + 1500)
				fm_give_item(iPlayer, "weapon_hegrenade")
				fm_give_item(iPlayer, "weapon_flashbang")
				fm_give_item(iPlayer, "weapon_smokegrenade")
				BIT_SUB(g_Can_Buy_Secondary, iPlayer);
			}
		} case 6: {
			if(get_money(iPlayer) >= 600) {
				//zp_knife_menus_show(iPlayer)
				//give_weapon_infinityss(iPlayer)
				set_money(iPlayer, get_money(iPlayer) + 600)
				fm_give_item(iPlayer, "weapon_hegrenade")
				fm_give_item(iPlayer, "weapon_flashbang")
				fm_give_item(iPlayer, "weapon_smokegrenade")
				BIT_SUB(g_Can_Buy_Secondary, iPlayer);
			}
		}
	}
	
	Show_Available_Buy_Menus(iPlayer)
}

public client_disconnected(iPlayer) BIT_SUB(g_iBit_Alive, iPlayer);
public zpe_fw_spawn_post_bit_add(iPlayer) BIT_ADD(g_iBit_Alive, iPlayer);
public zpe_fw_kill_pre_bit_sub(iPlayer) BIT_SUB(g_iBit_Alive, iPlayer);

stock Player_DropWeapons(const iPlayer, const iSlot) {
	new szWeaponName[32], iItem = get_pdata_cbase(iPlayer, 367 + iSlot, 5);
	while (pev_valid(iItem) == 2) {
		pev(iItem, pev_classname, szWeaponName, charsmax(szWeaponName));
		engclient_cmd(iPlayer, "drop", szWeaponName);
		iItem = get_pdata_cbase(iItem, 42, 4);
	}
}
Может подскажет кто, что не так? вроде обычное меню

Ecklory
Site Admin
Posts: 52

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#58 » Sun Feb 10, 2019 3:53 pm

Code: Select all

что не так?
А что именно не работает?

pach2580
Posts: 48

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#59 » Mon Feb 11, 2019 2:04 am

Все меню вообще никак не открывается, даже если напрямую делать

MonstrHW
Posts: 12

Re: [CS 1.6 / CS:CZ] Zombie Plague Enterprise

Post#60 » Mon Feb 11, 2019 3:54 am

Займитесь дебагом, ищите места в которых код не работает и найдете ошибку.

Who is online

Users browsing this forum: No registered users and 1 guest