Counter-Strike 1.6
CS1.BG | DUST2 NOSHTA GARMI [RANKED PLAY] #1
45.144.155.113:27015
de_dust2
Играчи: 30/32
de_dust2
Counter-Strike 1.6
Cs-PlovdiV.com - Aim Attack 93.123.16.4:27022 aim_aztec Играчи: 0/16

Add Round in Plugin

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Add Round in Plugin

Мнение от lantimilan » 25 Юни 2022, 01:32

Hello im try to make some changes to working deagel and grenade from round 2 and other weapons from round 3 dont work who can help me :
Deagle plus grenade to take from round 2
Deagle and Weapons to take from round 3

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

#include <amxmodx>
#include <reapi>
#include <fun>

const VIP_FLAG = ADMIN_LEVEL_C
const Float:VIP_HEALTH = 100.0
const Float:VIP_ARMOR = 100.0

new g_iMenu
new health_add
new health_hs_add
new health_max

new nKiller
new nKiller_hp
new nHp_add
new nHp_max

public plugin_init()
{
	register_plugin("VIP Plugin", "1.0", "OciXCrom")
	RegisterHookChain(RG_CBasePlayer_Spawn, "OnPlayerSpawn", 1)
	register_event("DeathMsg", "hook_death", "a", "1>0") 	
	health_add = register_cvar("amx_bonus_hp", "5")
	health_hs_add = register_cvar("amx_bonus_hp_hs", "7")
	health_max = register_cvar("amx_bonus_max_hp", "100")

   

	g_iMenu = menu_create("\r[H3aD$h0T VIP] \yARME FALAS", "Menu_Handler")
	menu_additem(g_iMenu, "Merr Ak47 + Deagle")
	menu_additem(g_iMenu, "Merr M4a1 + Deagle")
	menu_additem(g_iMenu, "Merr Famas + Deagle")
}

public hook_death(id)
{
	if(is_user_vip(id))
	{
   
   nKiller = read_data(1)

   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)

   nHp_max = get_pcvar_num (health_max)
   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add

   
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max

   set_user_health(nKiller, nKiller_hp)
  }
}

public OnPlayerSpawn(id)
{
	if(is_user_alive(id) && is_user_vip(id))
	{
		set_entvar(id, var_health, VIP_HEALTH)
		set_entvar(id, var_armorvalue, VIP_ARMOR)
		menu_display(id, g_iMenu)
	}
}


public Menu_Handler(id, iMenu, iItem)
{
	switch(iItem)
	{
		case MENU_EXIT:
		{
			return
		}
		case 0:
		{
			rg_give_item(id, "weapon_ak47", GT_REPLACE)
			rg_set_user_bpammo(id, WEAPON_AK47, 90)
		}
		case 1:
		{
			rg_give_item(id, "weapon_m4a1", GT_REPLACE)
			rg_set_user_bpammo(id, WEAPON_M4A1, 90)
		}
		case 2:
		{
			rg_give_item(id, "weapon_famas", GT_REPLACE)
			rg_set_user_bpammo(id, WEAPON_AWP, 90)
		}
	}

	rg_give_item(id, "weapon_deagle", GT_REPLACE)
	rg_give_item(id, "weapon_hegrenade")
	rg_give_item(id, "weapon_flashbang")
}

bool:is_user_vip(id)
{
	return bool:(get_user_flags(id) & VIP_FLAG)
}
Последно промяна от lantimilan на 20 Юли 2022, 17:42, променено общо 1 път.

Аватар
Radeon
Извън линия
Потребител
Потребител
Мнения: 143
Регистриран на: 04 Апр 2021, 11:30
Се отблагодари: 2 пъти
Получена благодарност: 34 пъти
Обратна връзка:

ADD Health in VIP

Мнение от Radeon » 25 Юни 2022, 10:52

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

#include <amxmodx>
#include <reapi>
#include <fun>

const VIP_FLAG = ADMIN_LEVEL_C
const Float:VIP_HEALTH = 100.0
const Float:VIP_ARMOR = 100.0

new g_iMenu
new health_add
new health_hs_add
new health_max

new nKiller
new nKiller_hp
new nHp_add
new nHp_max

public plugin_init()
{
	register_plugin("VIP Plugin", "1.0", "OciXCrom")
	RegisterHookChain(RG_CBasePlayer_Spawn, "OnPlayerSpawn", 1)
	register_event("DeathMsg", "hook_death", "a", "1>0") 	
	health_add = register_cvar("amx_bonus_hp", "7")
	health_hs_add = register_cvar("amx_bonus_hp_hs", "10")
	health_max = register_cvar("amx_bonus_max_hp", "100")

   

	g_iMenu = menu_create("\r[H3aD$h0T VIP] \yARME FALAS", "Menu_Handler")
	menu_additem(g_iMenu, "Merr Ak47 + Deagle")
	menu_additem(g_iMenu, "Merr M4a1 + Deagle")
	menu_additem(g_iMenu, "Merr Famas + Deagle")
}

public hook_death(id)
{
	if(is_user_vip(id))
	{
   
   nKiller = read_data(1)

   if ( (read_data(3) == 1) && (read_data(5) == 0) )
   {
      nHp_add = get_pcvar_num (health_hs_add)
   }
   else
      nHp_add = get_pcvar_num (health_add)

   nHp_max = get_pcvar_num (health_max)
   nKiller_hp = get_user_health(nKiller)
   nKiller_hp += nHp_add

   
   if (nKiller_hp > nHp_max) nKiller_hp = nHp_max

   set_user_health(nKiller, nKiller_hp)
  }
}

public OnPlayerSpawn(id)
{
	if(is_user_alive(id) && is_user_vip(id))
	{
		set_entvar(id, var_health, VIP_HEALTH)
		set_entvar(id, var_armorvalue, VIP_ARMOR)
		menu_display(id, g_iMenu)
	}
}


public Menu_Handler(id, iMenu, iItem)
{
	switch(iItem)
	{
		case MENU_EXIT:
		{
			return
		}
		case 0:
		{
			rg_give_item(id, "weapon_ak47", GT_REPLACE)
			rg_set_user_bpammo(id, WEAPON_AK47, 90)
		}
		case 1:
		{
			rg_give_item(id, "weapon_m4a1", GT_REPLACE)
			rg_set_user_bpammo(id, WEAPON_M4A1, 90)
		}
		case 2:
		{
			rg_give_item(id, "weapon_famas", GT_REPLACE)
			rg_set_user_bpammo(id, WEAPON_AWP, 90)
		}
	}

	rg_give_item(id, "weapon_deagle", GT_REPLACE)
	rg_give_item(id, "weapon_hegrenade")
	rg_give_item(id, "weapon_flashbang")
}

bool:is_user_vip(id)
{
	return bool:(get_user_flags(id) & VIP_FLAG)
}

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

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

Кой е на линия

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