[ZP] Extra Item : Damage Kit

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
User avatar
Rainq
Moderator
Moderator
Posts: 2642
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 1 time
Been thanked: 17 times
Contact:

30 Jan 2019, 01:27

Descriere: Acest plugin iti da 250 armura(poti seta cata armura vrei) , glow , shotgun si viata.


Descarcare: LINK RESURSE!

Code: Select all

#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <zombieplague>
#include <fun>
#include <fakemeta_util>

new cvar_knife_dmg, cvar_m3_dmg
new cvar_deagle_dmg, g_itemid, cvar_health, cvar_armor
new cvar_red, cvar_green, cvar_blue

new bool:g_bHasKitDamage[33], g_maxplayers, g_msgSayText

new const v_m3_model[] = "models/v_m3_released.mdl"
new const p_m3_model[] = "models/p_m3_released.mdl"

public plugin_init() 
{
	register_plugin("Damage Kit" , "1.3b", "lucas_7_94")
	register_cvar ("zp_extra_damage", "1.3b", FCVAR_SERVER)
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
	register_event("CurWeapon", "event_CurWeapon", "be", "1=1")
	g_itemid = zp_register_extra_item("Kit De Damage", 90, ZP_TEAM_HUMAN)
	cvar_m3_dmg = register_cvar ("zp_m3_damage", "6.0")
	cvar_knife_dmg = register_cvar ("zp_knife_damage", "4.0")
	cvar_deagle_dmg = register_cvar ("zp_deagle_damage", "6.0")
	cvar_health = register_cvar ("zp_kit_health", "100")
	cvar_armor = register_cvar ("zp_kit_armor", "250")
	cvar_red = register_cvar ("zp_kit_glow_R", "000")
	cvar_green = register_cvar ("zp_kit_glow_G", "255")
	cvar_blue = register_cvar ("zp_kit_glow_B", "255")
	g_maxplayers = get_maxplayers()
	g_msgSayText = get_user_msgid("SayText")
}

public plugin_precache()
{
	precache_model(v_m3_model)
	precache_model(p_m3_model)
}

public event_round_start() 
{
	for(new id = 1; id <= g_maxplayers; id++) 
		g_bHasKitDamage[id] = false 	
}

public zp_user_infected_post(infected, infector)
{
	if (g_bHasKitDamage[infected])
	{
		g_bHasKitDamage[infected] = false
	}
}

public fw_player_killed(victim, attacker, shouldgib)
{
	if(g_bHasKitDamage[victim])
	{
		KitDamage(victim, "^x04[Kit Damage] You do not have the kit Damage!")
		g_bHasKitDamage[victim] = false
	}
}

public zp_extra_item_selected(player, itemid)
{
	if (itemid == g_itemid)
	{
		if(g_bHasKitDamage[player])
		{
			KitDamage(player, "^x04[Zombie Plague] You've got the Damage Kit")
			zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + 50)
			
			return;
		}
		else
		{
			g_bHasKitDamage[player] = true
			fm_set_user_health(player, get_user_health(player) + get_pcvar_num(cvar_health));
			fm_set_user_armor(player, get_user_armor(player) + get_pcvar_num(cvar_armor));
			fm_set_rendering(player, kRenderFxGlowShell, (cvar_red), (cvar_green), (cvar_blue), kRenderNormal, 16);
			fm_strip_user_weapons(player)
			give_item(player, "weapon_knife")
			give_item(player, "weapon_deagle")
			give_item(player, "weapon_m3")
			KitDamage(player, "^x04[Zombie Plague] You purchased a kit Damage!!")
		}
	}
}

public event_CurWeapon(id)
{
	new weapid = read_data(2)
	
	if(!is_user_alive(id))
		return;
	
	if(g_bHasKitDamage[id] && weapid == CSW_M3)
	{
		entity_set_string(id, EV_SZ_viewmodel, v_m3_model)  
		entity_set_string(id, EV_SZ_weaponmodel, p_m3_model)	
	}
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
	if(!(1 <= attacker <= g_maxplayers))
		return HAM_IGNORED;
	
	if(get_user_weapon(attacker) != CSW_M3)
		if(get_user_weapon(attacker) != CSW_DEAGLE)
		if(get_user_weapon(attacker) != CSW_KNIFE)
		return HAM_IGNORED;
	
	if (get_user_weapon(attacker) && g_bHasKitDamage[attacker])
	{
		SetHamParamFloat(4, damage * get_pcvar_float(cvar_m3_dmg))
		SetHamParamFloat(4, damage * get_pcvar_float(cvar_deagle_dmg))
		SetHamParamFloat(4, damage * get_pcvar_float(cvar_knife_dmg))
	}
	
	return HAM_IGNORED;
}  

KitDamage(target, const message[], any:...)
{
static buffer[512], i, argscount
argscount = numargs()

// Send to everyone
if (!target)
{
	static player
	for (player = 1; player <= g_maxplayers; player++)
	{
		// Not connected
		if (!is_user_connected(player))
			continue;
			
			static changed[5], changedcount;
			changedcount = 0
			
			for (i = 2; i < argscount; i++)
			{
				if (getarg(i) == LANG_PLAYER)
				{
					setarg(i, 0, player)
					changed[changedcount] = i
					changedcount++
				}
			}
			
			vformat(buffer, sizeof buffer - 1, message, 3)
			
			message_begin(MSG_ONE, g_msgSayText, _, player)
			write_byte(player)
			write_string(buffer)
			message_end()
			
			for (i = 0; i < changedcount; i++)
				setarg(changed[i], 0, LANG_PLAYER)
		}
	}
	else
	{
		
		// Format message for player
		vformat(buffer, sizeof buffer - 1, message, 3)
		
		// Send it
		message_begin(MSG_ONE, g_msgSayText, _, target)
		write_byte(target)
		write_string(buffer)
		message_end()
	}
}
Nume: Kit damage
Versiune: -
Link oficial: click


Instalare:
1. Fisierul zp_extra_kit_damage.sma il puneti in addons/amxmodx/scripting
2. Fisierul zp_extra_kit_damage.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins-zplague.ini si adaugati la urma:

Code: Select all

zp_extra_kit_damage.amxx
4. Alti pasi necesari....

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
zp_m3_damage 6.0 (cat damage sa dea shotgun-ul)
zp_knife_damage 4.0 (cat damage sa dea cutitul)
zp_deagle_damage 6.0 (cat damage sa dea deagle)
zp_kit_health 100 (aici setati voi cat hp sa dea in plus)
zp_kit_armor 250 (aici setati voi armura,eu am setat 250,puteti sa o setati cum vreti)
zp_kit_glow_R 000 |
zp_kit_glow_G 255 |--> aici setati culorile la glow
zp_kit_glow_B 255 |


Imagini: Apare in meniu.
Image

Ca sa editati cat sa coste in meniu:
g_itemid = zp_register_extra_item("Kit De Damage", 90, ZP_TEAM_HUMAN) , modificati acolo unde scrie 90 ,puneti cat vreti sau din zp_extraitems.ini
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
User avatar
Orochimaru12345
Membru, skill 0
Membru, skill 0
Posts: 7
Joined: 06 Mar 2019, 11:22
Detinator Steam: Da
CS Status: Bizar !
Detinator server CS: :)
SteamID: LoRDd3V1L
Fond eXtream: 0

12 Mar 2019, 08:47

Daca tot faci un tutorial fa-l pana la capat pentru ca este incomplet
Stii vreun caz de deces vesel?
User avatar
Rainq
Moderator
Moderator
Posts: 2642
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ---
Reputatie: Moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucuresti
Has thanked: 1 time
Been thanked: 17 times
Contact:

12 Mar 2019, 10:22

Orochimaru12345 wrote:
12 Mar 2019, 08:47
Daca tot faci un tutorial fa-l pana la capat pentru ca este incomplet
nu este tutorial,este plugin,eu am explicat putin mai clar unde si ce sa modifici
Image
Leul si tigru sunt mai puternici ca lupul,dar lupul la circ nu participa.
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests