Преработка на плъгина "VZBB Vip System"

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
ChrisBenoit
Извън линия
Потребител
Потребител
Мнения: 67
Регистриран на: 30 Яну 2021, 19:37
Се отблагодари: 19 пъти
Получена благодарност: 1 път
Обратна връзка:

Преработка на плъгина "VZBB Vip System"

Мнение от ChrisBenoit » 21 Фев 2021, 23:22

Здравейте,
Може ли да се направи така че да се махнат менютата от плъгин?
Искам само тези да останат:
vzbb_vip_x_dmg "2"
vzbb_vip_show_connect_msg "1"
vzbb_vip_show_disconnect_msg "1"
vzbb_vip_headshot_kill_credits "50"
vzbb_vip_normal_kill_credits "25"
vzbb_vip_x_credits "1"
vzbb_vip_frags_for_credits "1"
vzbb_vip_spawn_cha "1"

Ето и кода на плъгина

Код за потвърждение: Избери целия код

/*
________________________________________________
*	*            ******	        *    *
*	*            *    *	        *   *
*	*            *    *	        *  *
*	*            *    *	        * *
*********	     ***** 	        **
*	*     	     *    *	        * *
*	*   ******   *    *   ******    *  *
*	*   *    *   *	  *   *    *    *   *
*	*   *    *   *    *   *    *    *    *
*	*   ******   ******   ********  *     *
________________________________________________


================================================
		   Changelog
================================================
    Version                Changes
      1.0	 The first release of the plugin
      1.1		Edited all bugs.
================================================
*/

#include <amxmodx>
#include <amxmisc>
#include <vzbb_mod>
#include <hamsandwich>
#include <engine>
#include <colorchat>
#include <fun>
#include <cstrike>

#define ACCESS_TO_VIP ADMIN_IMMUNITY

// Global String
new const g_sz_Plugin_Version[] = "1.1" 
new const g_sz_Plugin_Prefix[] = "[VZBB]"
new g_sz_zombie_aio_mdl[128]
new g_sz_zombie_aio_claw_mdl[128]
new g_sz_zombie_scthp_mdl[128]
new g_sz_zombie_scthp_claw_mdl[128]

// Global Bool
new bool:user_have_weapon[33]
new bool:user_have_zm_vip_class[33]

// Global Integers
new	g_p_zclass_scthp,
	g_p_zclass_aio

// Global Pointers
new	g_p_cvar_no_fall,
	g_p_cvar_x_dmg,
	g_p_cvar_x_dmg_type ,
	g_p_cvar_round_start_credits,
	g_p_cvar_round_start_hp,
	g_p_cvar_round_start_armor,
	g_p_cvar_show_connect_msg,
	g_p_cvar_show_disconnect_msg,
	g_p_cvar_headshot_kill_credits,
	g_p_cvar_normal_kill_credits,
	g_p_cvar_menu,
	g_p_cvar_zombie_classes_menu,
	g_p_cvar_extras_menu,
	g_p_cvar_weapons_menu,
	g_p_cvar_zombie_all_in_one,
	g_p_cvar_zombie_see_ct_hp,
	g_p_cvar_zombie_scthp_health,
	g_p_cvar_zombie_scthp_skin,
	g_p_cvar_zombie_scthp_claw,
	g_p_cvar_zombie_scthp_gravity,
	g_p_cvar_zombie_scthp_speed,
	g_p_cvar_zombie_aio_skin,
	g_p_cvar_zombie_aio_claw,
	g_p_cvar_zombie_aio_health,
	g_p_cvar_zombie_aio_gravity,
	g_p_cvar_zombie_aio_speed,
	g_p_cvar_weapon_sg550,
	g_p_cvar_weapon_g3sg1,
	g_p_cvar_weapon_deagle,
	g_p_cvar_weapon_elite,
	g_p_cvar_weapon_m4a1,
	g_p_cvar_weapon_ak47,
	g_p_cvar_weapon_galil,
	g_p_cvar_weapon_bpammo_sg550,
	g_p_cvar_weapon_bpammo_g3sg1,
	g_p_cvar_weapon_bpammo_deagle,
	g_p_cvar_weapon_bpammo_elite,
	g_p_cvar_weapon_bpammo_m4a1,
	g_p_cvar_weapon_bpammo_ak47,
	g_p_cvar_weapon_bpammo_galil,
	g_p_cvar_x_credits,
	g_p_cvar_frags_for_credits,
	g_p_cvar_reset_score,
	g_p_cvar_spawn_give_cha
	
new const g_sz_VIP_Menu_Commands[][]=
{
	"say /vm",
	"say_team /vm",
	"say !vm",
	"say_team !vm",
	"say /vip",
	"say_team /vip",
	"say !vip",
	"say_team !vip"
}
	
public plugin_init() 
{
	/* REGISTER COMMANDS */
	register_plugin("[VZBB] VIP System", g_sz_Plugin_Version,"HoBaK")
	RegisterHam(Ham_TakeDamage, "player", "hook_damage")
	RegisterHam(Ham_Spawn, "player", "hook_spawn", 1)
	register_event("DeathMsg", "hook_player_death", "a")
	register_event("HLTV", "New_Round", "a", "1=0", "2=0")
	register_clcmd("say /wantvip", "User_Help_Motd")
	register_clcmd("say_team /wantvip", "User_Help_Motd")
	register_clcmd("frags", "frags_for_credits")
	for(new i = 0; i < sizeof g_sz_VIP_Menu_Commands; i ++)
	{
		register_clcmd(g_sz_VIP_Menu_Commands[i], "vip_menu")
	}
	
	/* STANDART SYSTEM CVARS */
	g_p_cvar_no_fall = register_cvar("vzbb_vip_no_fall", "1")
	g_p_cvar_x_dmg_type = register_cvar("vzbb_vip_x_dmg_type", "1")
	g_p_cvar_x_dmg = register_cvar("vzbb_vip_x_dmg", "2")
	g_p_cvar_round_start_credits = register_cvar("vzbb_vip_round_start_credits", "10")
	g_p_cvar_round_start_hp = register_cvar("vzbb_vip_round_start_hp", "150")
	g_p_cvar_round_start_armor = register_cvar("vzbb_vip_round_start_armor", "100")
	g_p_cvar_show_connect_msg = register_cvar("vzbb_vip_show_connect_msg", "1")
	g_p_cvar_show_disconnect_msg = register_cvar("vzbb_vip_show_disconnect_msg", "1")
	g_p_cvar_headshot_kill_credits = register_cvar("vzbb_vip_headshot_kill_credits", "50")
	g_p_cvar_normal_kill_credits = register_cvar("vzbb_vip_normal_kill_credits", "25")
	g_p_cvar_spawn_give_cha = register_cvar("vzbb_vip_spawn_cha", "1")
	
	/* ON/OFF FOR MENU */
	g_p_cvar_menu = register_cvar("vzbb_vip_general_menu", "1")
	g_p_cvar_zombie_classes_menu = register_cvar("vzbb_vip_zombie_class_menu", "1")
	g_p_cvar_extras_menu = register_cvar("vzbb_vip_extras_menu", "1")
	g_p_cvar_weapons_menu = register_cvar("vzbb_vip_weapons_menu", "1")
	
	/* EXTRAS CVAR */
	g_p_cvar_x_credits = register_cvar("vzbb_vip_x_credits", "1")
	g_p_cvar_frags_for_credits = register_cvar("vzbb_vip_frags_for_credits", "1")
	g_p_cvar_reset_score = register_cvar("vzbb_vip_reset_score", "1")
	
	/* WEAPON CVAR ON/OFF */
	g_p_cvar_weapon_sg550 = register_cvar("vzbb_vip_weapon_sg550", "1")
	g_p_cvar_weapon_g3sg1 = register_cvar("vzbb_vip_weapon_g3sg1", "1")
	g_p_cvar_weapon_deagle = register_cvar("vzbb_vip_weapon_deagle", "1")
	g_p_cvar_weapon_elite = register_cvar("vzbb_vip_weapon_elite", "1")
	g_p_cvar_weapon_m4a1 = register_cvar("vzbb_vip_weapon_m4a1", "1")
	g_p_cvar_weapon_ak47 = register_cvar("vzbb_vip_weapon_ak47", "1")
	g_p_cvar_weapon_galil = register_cvar("vzbb_vip_weapon_galil", "1")
	
	/* WEAPON BPAMMO CVAR */
	g_p_cvar_weapon_bpammo_sg550 = register_cvar("vzbb_vip_weapon_bpammo_sg550", "90")
	g_p_cvar_weapon_bpammo_g3sg1 = register_cvar("vzbb_vip_weapon_bpammo_g3sg1", "90")
	g_p_cvar_weapon_bpammo_deagle = register_cvar("vzbb_vip_weapon_bpammo_deagle", "35")
	g_p_cvar_weapon_bpammo_elite = register_cvar("vzbb_vip_weapon_bpammo_elite", "120")
	g_p_cvar_weapon_bpammo_m4a1 = register_cvar("vzbb_vip_weapon_bpammo_m4a1", "90")
	g_p_cvar_weapon_bpammo_ak47 = register_cvar("vzbb_vip_weapon_bpammo_ak47", "90")
	g_p_cvar_weapon_bpammo_galil= register_cvar("vzbb_vip_weapon_bpammo_galil", "90")
}

public plugin_precache()
{
	/* ZOMBIE CLASS ALL IN ONE */
	g_p_cvar_zombie_all_in_one = register_cvar("vzbb_vip_zm_class_all_in_one", "1")
	g_p_cvar_zombie_aio_health = register_cvar("vzbb_vip_zm_class_aio_health", "4000")
	g_p_cvar_zombie_aio_gravity = register_cvar("vzbb_vip_zm_class_aio_gravity", "0.5")
	g_p_cvar_zombie_aio_speed = register_cvar("vzbb_vip_zm_class_aio_speed", "1000.0")
	g_p_cvar_zombie_aio_skin = register_cvar("vzbb_vip_zm_class_aio_skin", "zombie_source")
	g_p_cvar_zombie_aio_claw = register_cvar("vzbb_vip_zm_class_aio_claw", "v_claws")
	get_pcvar_string(g_p_cvar_zombie_aio_skin ,g_sz_zombie_aio_mdl,127)
	get_pcvar_string(g_p_cvar_zombie_aio_claw,g_sz_zombie_aio_claw_mdl,127)
	
	/* ZOMBIE CLASS SEE COUNTER-TERRORIST HEALTH */
	g_p_cvar_zombie_see_ct_hp = register_cvar("vzbb_vip_zm_class_see_ct_hp", "1")
	g_p_cvar_zombie_scthp_health = register_cvar("vzbb_vip_zm_class_scthp_health", "5000")
	g_p_cvar_zombie_scthp_gravity = register_cvar("vzbb_vip_zm_class_scthp_gravity", "1.0")
	g_p_cvar_zombie_scthp_speed = register_cvar("vzbb_vip_zm_class_scthp_speed", "0.0")
	g_p_cvar_zombie_scthp_skin = register_cvar("vzbb_vip_zm_class_scthp_skin", "zombie_source")
	g_p_cvar_zombie_scthp_claw = register_cvar("vzbb_vip_zm_class_scthp_claw", "v_claws")
	get_pcvar_string(g_p_cvar_zombie_scthp_skin ,g_sz_zombie_scthp_mdl,127)
	get_pcvar_string(g_p_cvar_zombie_scthp_claw,g_sz_zombie_scthp_claw_mdl,127)
	
	/* REGISTER ZOMBIE CLASS */
	g_p_zclass_scthp = register_zombie_class("Zombie See CT Health","You can see the CT Health", g_sz_zombie_scthp_mdl,g_sz_zombie_scthp_claw_mdl,get_pcvar_num(g_p_cvar_zombie_scthp_health), get_pcvar_float(g_p_cvar_zombie_scthp_gravity), get_pcvar_float(g_p_cvar_zombie_scthp_speed), ACCESS_TO_VIP)
	g_p_zclass_aio = register_zombie_class("Zombie All in One","All standart class in one",g_sz_zombie_aio_mdl,g_sz_zombie_aio_claw_mdl,get_pcvar_num(g_p_cvar_zombie_aio_health), get_pcvar_float(g_p_cvar_zombie_aio_gravity), get_pcvar_float(g_p_cvar_zombie_aio_speed), ACCESS_TO_VIP)
}

public plugin_cfg()
{
	new cfg_file[31]
	get_configsdir(cfg_file, 30)
	if(file_exists(cfg_file))
	{
		server_cmd("exec %s/vzbb_vip.cfg", cfg_file)
		log_amx("[VZBB] All CVARS Are Loaded")
	} else {
		log_amx("[VZBB] ERROR: File configs/vzbb_vip.cfg doesn't exist!")
		log_amx("[VZBB] Default CVAR values will be loaded instead.")
	}
}

public New_Round()
{
	arrayset(user_have_weapon, false, charsmax(user_have_weapon))
	arrayset(user_have_zm_vip_class, false, charsmax(user_have_zm_vip_class))
}

public hook_player_death()
{
	new attacker = read_data(1)
	new victim = read_data(2)
	if(attacker != victim && is_user_connected(attacker) && get_user_flags(attacker) & ACCESS_TO_VIP)
	{
		new hs = read_data(3)
		new nickname[32]
		new normal_kill = get_pcvar_num(g_p_cvar_normal_kill_credits)
		new headshot_kill = get_pcvar_num(g_p_cvar_headshot_kill_credits)
		get_user_name(victim, nickname, charsmax(nickname))
		
		if(hs)
		{
			ColorChat(attacker, GREEN, "%s ^1You make headshot kill on ^3%s ^1and get ^3%i credits ^1for kill.", g_sz_Plugin_Prefix, nickname, headshot_kill)
			set_user_credits(attacker, get_user_credits(attacker) + headshot_kill)
		} else {
			ColorChat(attacker, GREEN, "%s ^1You make normal kill on ^3%s ^1and get ^3%i credits ^1for kill.", g_sz_Plugin_Prefix, nickname, normal_kill)
			set_user_credits(attacker, get_user_credits(attacker) + normal_kill)
		}
	}
	
	user_have_zm_vip_class[victim] = false
}

public hook_spawn(id)
{
	if(is_user_alive(id) && get_user_flags(id) & ACCESS_TO_VIP)
	{
		if(get_pcvar_num(g_p_cvar_spawn_give_cha) >= 1)
		{
			new start_credits = get_pcvar_num(g_p_cvar_round_start_credits)
			new start_hp = get_pcvar_num(g_p_cvar_round_start_hp)
			new start_armor = get_pcvar_num(g_p_cvar_round_start_armor)
			set_user_credits(id, get_user_credits(id) + start_credits)
			set_user_health(id, start_hp)
			set_user_armor(id, start_armor)
			ColorChat(id, GREEN, "%s ^1You earn ^3%i credits ^1and start with ^3%i HP ^1and ^3%i Armor.", g_sz_Plugin_Prefix, start_credits, start_hp, start_armor)
		}
	}
}

public hook_damage(victim, inflictor, attacker, Float:damage, damage_type) 
{
	if(is_user_connected(attacker))
	{
		if(is_user_zombie(attacker) && get_user_zombie_class(attacker) == g_p_zclass_scthp)
		{
			new nick[32]
			get_user_name(victim, nick, charsmax(nick))
			client_print(attacker,print_center,"The %s health is %i", nick, get_user_health(victim))
		}
		if(get_pcvar_num(g_p_cvar_x_dmg_type ) >= 1 && get_user_flags(attacker) & ACCESS_TO_VIP)
		{
			SetHamParamFloat(4, damage * get_pcvar_num(g_p_cvar_x_dmg))
		}
	}
	if(damage_type & DMG_FALL && get_pcvar_num(g_p_cvar_no_fall) && get_user_flags(victim) & ACCESS_TO_VIP)
	{
		return HAM_SUPERCEDE
	}
	return HAM_IGNORED
}

public User_Help_Motd(id) 
{
	show_motd(id, "addons/amxmodx/configs/vzbb_vip.txt","[VZBB] VIP Privileges")
}

public client_authorized(id)
{
	if(get_pcvar_num(g_p_cvar_show_connect_msg) >= 1 && get_user_flags(id) & ACCESS_TO_VIP)
	{
		new vip_name[32]
		get_user_name(id, vip_name, charsmax(vip_name))
		ColorChat(0, GREEN, "%s ^1VIP ^3%s ^1has join the server.", g_sz_Plugin_Prefix, vip_name)
	}
}

public client_disconnect(id)
{
	if(get_pcvar_num(g_p_cvar_show_disconnect_msg) >= 1 && get_user_flags(id) & ACCESS_TO_VIP)
	{
		new vip_name[32]
		get_user_name(id, vip_name, charsmax(vip_name))
		ColorChat(0, GREEN, "%s ^1VIP ^3%s ^1has left from the server.", g_sz_Plugin_Prefix, vip_name)
	}
}

public frags_for_credits(id)
{
	if(get_user_flags(id) & ACCESS_TO_VIP)
	{
		new args[4]
		read_argv(1,args,charsmax(args))
		remove_quotes(args)
		new num_frags = str_to_num(args)
		if(get_user_frags(id) < num_frags)
		{
			ColorChat(id,GREEN,"%s ^1You don't have enough frags.", g_sz_Plugin_Prefix)
			return
		} else if(num_frags < 0)
		{
			ColorChat(id,GREEN,"%s ^1You can change only positive frags.", g_sz_Plugin_Prefix)
			return
		} else {
			new num_credits = num_frags * get_pcvar_num(g_p_cvar_x_credits)
			set_user_frags(id, get_user_frags(id) - num_frags)
			set_user_credits(id, get_user_credits(id) + num_credits)
			ColorChat(id, GREEN, "%s ^1You successfully change %i frags for %i credits", g_sz_Plugin_Prefix, num_frags, num_credits)
		}
	} else {
		ColorChat(id, GREEN, "%s ^1You don't have access to this extra", g_sz_Plugin_Prefix)
	}
}

public vip_menu(id)
{
	if(get_pcvar_num(g_p_cvar_menu) >= 1)
	{
		if(get_user_flags(id) & ACCESS_TO_VIP)
		{
			new menu = menu_create("\r[\yVZBB\r] \yVIP \rMenu","vip_menu_handler")
			if(get_pcvar_num(g_p_cvar_zombie_classes_menu) >= 1)
			{
				menu_additem(menu, "VIP Zombie Classes", "1") 
			}
			if(get_pcvar_num(g_p_cvar_extras_menu) >= 1)
			{
				menu_additem(menu, "VIP Extras", "2") 
			}
			if(get_pcvar_num(g_p_cvar_weapons_menu) >= 1)
			{
				menu_additem(menu, "VIP Weapons", "3")
			}
			menu_setprop(menu, MPROP_NUMBER_COLOR, "\r")
			menu_display(id,menu)
		} else {
			ColorChat(id, GREEN, "%s ^1You don't have access to command.", g_sz_Plugin_Prefix)
		}
	} else {
		ColorChat(id, GREEN, "%s ^1The menu now is not work, say to administrator for edit the cvar.", g_sz_Plugin_Prefix)
	}
}

public vip_menu_handler(id,menu,item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new access, callback, info[4], name[32], get_info
	menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback);

	get_info = str_to_num(info)

	switch(get_info)
	{
		case 1:
		{
			vip_zombie_class_menu(id)
		}
		case 2:
		{
			vip_extras_menu(id)
		}
		case 3:
		{
			vip_weapons_menu(id)
		}
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public vip_zombie_class_menu(id)
{
	if(is_user_zombie(id))
	{
		if(get_pcvar_num(g_p_cvar_zombie_classes_menu) >= 1)
		{
			if(get_user_flags(id) & ACCESS_TO_VIP)
			{
				new menu = menu_create("\r[\yVZBB\r] \yVIP \rZombie Classes","vip_zm_class_menu_handler")
				if(get_pcvar_num(g_p_cvar_zombie_all_in_one) >= 1)
				{
					menu_additem(menu, "Zombie All in One", "1") 
				}
				if(get_pcvar_num(g_p_cvar_zombie_see_ct_hp) >= 1)
				{
					menu_additem(menu, "Zombie See CT Health", "2") 
				}
				menu_setprop(menu, MPROP_NUMBER_COLOR, "\r")
				menu_display(id,menu)
			} else {
				ColorChat(id, GREEN, "%s ^1You don't have access to command.", g_sz_Plugin_Prefix)
			}
		} else {
			ColorChat(id, GREEN, "%s ^1The menu now is not work, say to administrator for edit the cvar.", g_sz_Plugin_Prefix)
		}
	} else {
		ColorChat(id, GREEN, "%s ^1The menu not work for humans.", g_sz_Plugin_Prefix)
	}
}

public vip_zm_class_menu_handler(id,menu,item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new access, callback, info[4], name[32], get_info
	menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback);

	get_info = str_to_num(info)
	if(user_have_zm_vip_class[id] == false)
	{
		switch(get_info)
		{
			case 1:
			{
				set_user_zombie_class(id, g_p_zclass_aio)
			}
			case 2:
			{
				set_user_zombie_class(id, g_p_zclass_scthp)
			}
		}
		user_have_zm_vip_class[id] = true
	} else {
		ColorChat(id, GREEN, "%s ^1You can't change zombie class this round.", g_sz_Plugin_Prefix)
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public vip_extras_menu(id)
{
	if(get_pcvar_num(g_p_cvar_extras_menu) >= 1)
	{
		if(get_user_flags(id) & ACCESS_TO_VIP)
		{
			new menu = menu_create("\r[\yVZBB\r] \yVIP \rAccount Extras","vip_extras_menu_handler")
			if(get_pcvar_num(g_p_cvar_reset_score) >= 1)
			{
				menu_additem(menu, "Reset Score", "1") 
			}
			if(get_pcvar_num(g_p_cvar_frags_for_credits) >= 1)
			{
				menu_additem(menu, "Frags For Credits", "2") 
			}
			menu_setprop(menu, MPROP_NUMBER_COLOR, "\r")
			menu_display(id,menu)
		} else {
			ColorChat(id, GREEN, "%s ^1You don't have access to command.", g_sz_Plugin_Prefix)
		}
	} else {
		ColorChat(id, GREEN, "%s ^1The menu now is not work, say to administrator for edit the cvar.", g_sz_Plugin_Prefix)
	}
}

public vip_extras_menu_handler(id,menu,item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new access, callback, info[4], name[32], get_info
	menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback);

	get_info = str_to_num(info)

	switch(get_info)
	{
		case 1:
		{
			if(get_user_frags(id) == 0 && cs_get_user_deaths(id) == 0)
			{
				ColorChat(id, GREEN, "%s ^1You not reset your stats because your stats is 0/0.", g_sz_Plugin_Prefix)
			} else {
				set_user_frags(id, 0)
				cs_set_user_deaths(id, 0)
				ColorChat(id, GREEN, "%s ^1You successfully reset your stats.", g_sz_Plugin_Prefix)
			}
		}
		case 2:
		{
			client_cmd(id, "messagemode frags")
		}
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}

public vip_weapons_menu(id)
{
	if(is_user_human(id))
	{
		if(get_pcvar_num(g_p_cvar_weapons_menu) >= 1)
		{
			if(get_user_flags(id) & ACCESS_TO_VIP)
			{
				new menu = menu_create("\r[\yVZBB\r] \yFree \rVIP Weapons for You","vip_weapons_menu_handler")
				if(get_pcvar_num(g_p_cvar_weapon_sg550) >= 1)
				{
					menu_additem(menu, "[CLASS:SNIPER] SG550", "1") 
				}
				if(get_pcvar_num(g_p_cvar_weapon_g3sg1) >= 1)
				{
					menu_additem(menu, "[CLASS:SNIPER] G3SG1", "2") 
				}
				if(get_pcvar_num(g_p_cvar_weapon_deagle) >= 1)
				{
					menu_additem(menu, "[CLASS:PISTOL] DEAGLE", "3") 
				}
				if(get_pcvar_num(g_p_cvar_weapon_elite) >= 1)
				{
					menu_additem(menu, "[CLASS:PISTOL] ELITE", "4") 
				}
				if(get_pcvar_num(g_p_cvar_weapon_m4a1) >= 1)
				{
					menu_additem(menu, "[CLASS:PRIMARY] M4A1", "5")
				}
				if(get_pcvar_num(g_p_cvar_weapon_ak47) >= 1)
				{
					menu_additem(menu, "[CLASS:PRIMARY] AK47", "6") 
				}
				if(get_pcvar_num(g_p_cvar_weapon_galil) >= 1)
				{
					menu_additem(menu, "[CLASS:PRIMARY] GALIL", "7") 
				}
				menu_setprop(menu, MPROP_NUMBER_COLOR, "\r")
				menu_display(id,menu)
			} else {
				ColorChat(id, GREEN, "%s ^1You don't have access to command.", g_sz_Plugin_Prefix)
			}
		} else {
			ColorChat(id, GREEN, "%s ^1The menu now is not work, say to administrator for edit the cvar.", g_sz_Plugin_Prefix)
		}
	} else {
		ColorChat(id, GREEN, "%s ^1The menu not work for zombies.", g_sz_Plugin_Prefix)
	}
}

public vip_weapons_menu_handler(id,menu,item)
{
	if(item == MENU_EXIT) 
	{
		menu_destroy(menu)
		return PLUGIN_HANDLED
	}
	
	new access, callback, info[4], name[32], get_info
	menu_item_getinfo(menu, item, access, info, charsmax(info), name, charsmax(name), callback);

	get_info = str_to_num(info)

	if(user_have_weapon[id] == false)
	{
		switch(get_info)
		{
			case 1:
			{
				give_item(id, "weapon_sg550")
				cs_set_user_bpammo(id, CSW_SG550, get_pcvar_num(g_p_cvar_weapon_bpammo_sg550))
				ColorChat(id, GREEN, "%s ^1You get the sniper ^3SG550.", g_sz_Plugin_Prefix)
			}
			case 2:
			{
				give_item(id, "weapon_g3sg1")
				cs_set_user_bpammo(id, CSW_G3SG1, get_pcvar_num(g_p_cvar_weapon_bpammo_g3sg1))
				ColorChat(id, GREEN, "%s ^1You get the sniper ^3GS3G1.", g_sz_Plugin_Prefix)
			}
			case 3:
			{
				give_item(id, "weapon_deagle")
				cs_set_user_bpammo(id, CSW_DEAGLE, get_pcvar_num(g_p_cvar_weapon_bpammo_deagle))
				ColorChat(id, GREEN, "%s ^1You get the pistol ^3DEAGLE.", g_sz_Plugin_Prefix)
			}
			case 4:
			{
				give_item(id, "weapon_elite")
				cs_set_user_bpammo(id, CSW_ELITE, get_pcvar_num(g_p_cvar_weapon_bpammo_elite))
				ColorChat(id, GREEN, "%s ^1You get the pistol ^3ELITE.", g_sz_Plugin_Prefix)
			}
			case 5:
			{
				give_item(id, "weapon_m4a1")
				cs_set_user_bpammo(id, CSW_M4A1, get_pcvar_num(g_p_cvar_weapon_bpammo_m4a1))
				ColorChat(id, GREEN, "%s ^1You get the primary ^3M4A1.", g_sz_Plugin_Prefix)
			}
			case 6:
			{
				give_item(id, "weapon_ak47")
				cs_set_user_bpammo(id, CSW_AK47, get_pcvar_num(g_p_cvar_weapon_bpammo_ak47))
				ColorChat(id, GREEN, "%s ^1You get the primary ^3AK47.", g_sz_Plugin_Prefix)
			}
			case 7:
			{
				give_item(id, "weapon_galil")
				cs_set_user_bpammo(id, CSW_GALIL, get_pcvar_num(g_p_cvar_weapon_bpammo_galil))
				ColorChat(id, GREEN, "%s ^1You get the primary ^3GALIL.", g_sz_Plugin_Prefix)
			}
		}
		user_have_weapon[id] = true
	} else {
		ColorChat(id, GREEN, "%s ^1You can't get again weapon.", g_sz_Plugin_Prefix)
	}
	menu_destroy(menu)
	return PLUGIN_HANDLED
}
Enjoy Highserv.eu Servers
Dust2Only IP: 93.123.18.21:27016
BaseBuilder IP: 93.123.18.21:27017
Forum: www.highserv.eu/forum/

Аватар
ChrisBenoit
Извън линия
Потребител
Потребител
Мнения: 67
Регистриран на: 30 Яну 2021, 19:37
Се отблагодари: 19 пъти
Получена благодарност: 1 път
Обратна връзка:

Преработка на плъгина "VZBB Vip System"

Мнение от ChrisBenoit » 22 Фев 2021, 21:32

Може да заключвате темата.Ще го ползвам както е направен. :)
Enjoy Highserv.eu Servers
Dust2Only IP: 93.123.18.21:27016
BaseBuilder IP: 93.123.18.21:27017
Forum: www.highserv.eu/forum/

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: Google Adsense [Bot] и 10 госта