Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Srebrna Amunicja


  • Zamknięty Temat jest zamknięty
1 odpowiedź w tym temacie

#1 Wizzardius

    Pomocny

  • Użytkownik

Reputacja: 61
Pomocny

  • Postów:41
  • Lokalizacja:Sieardz
Offline

Napisano 17.07.2009 14:37

1.Otóż ten plugin w ogóle nie działa... to znaczy, iteam kupic można, jak strzelasz to spirit jest (taka biala smuga za nabojem), lecz obrazenia sa takie same.... zmieniłem to:

/* Silver Bullets */
    damage_faktor = register_cvar("zp_silver_bullets_damage_factor", "5.0")
    g_silver_bullets_cost = register_cvar("zp_silver_bullets_cost", "40")

I cena sie zmieniła, lecz obrazenia nie... proszę tutaj daje cały plugin i proszę o pomoc ;(

/*
                [ZP] Extra Item : Silver Bullets
                     ( ability for Humans )
                    by Fry! & SnoW



    Description :
            When You will buy these Silver Bullets ammos will be different and will be able
            to do screen shake as well, You will create more damage to victim (can change by cvar).

    Cvars :
            - Silver Bullets
            zp_silver_bullets_damage_factor "1.5"    - How much damage bullets will do.
            zp_silver_bullets_cost "13"        - How much Silver Bullets will cost.
           

    Credits :
            SnoW     - for his Silver bullets plugin! <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/wink.gif' class='bbc_emoticon' alt=';)' />


    Changelog :

            08/01/2009 - v1.0 - First release

*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item : Magic Bullets"
#define VERSION "1.0.3"
#define AUTHOR "Fry! & SnoW"

#define LAST 0
#define FULL 1

new m_spriteTexture
new damage_factor
new fov_value, shake_value
new has_sbullets[33], last_bullet[33]

new g_item_name1[] = "Silver Bullets"
new g_itemid_silverb, g_silver_bullets_cost

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
   
    register_cvar("zp_extra_magic_bullets",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
   
    fov_value = get_user_msgid("SetFOV")
    shake_value = get_user_msgid ("ScreenShake")
   
    /* Silver Bullets */
    damage_factor = register_cvar("zp_silver_bullets_damage_factor", "5.0")
    g_silver_bullets_cost = register_cvar("zp_silver_bullets_cost", "40")
    g_itemid_silverb = zp_register_extra_item(g_item_name1, get_pcvar_num(g_silver_bullets_cost), ZP_TEAM_HUMAN)
   
   
    register_forward(FM_PlayerPreThink, "PreThink")
   
    RegisterHam(Ham_TakeDamage, "player", "Damage")
    RegisterHam(Ham_Spawn, "player", "Spawn", 1)       
}

public plugin_precache()
{
    m_spriteTexture = precache_model("sprites/dot.spr")
}

public PreThink(id)
{
    if(!is_user_alive(id))
        return FMRES_IGNORED
    new weapon, clip, ammo
    weapon = get_user_weapon(id,clip,ammo)
    if(~pev(id, pev_button) & IN_ATTACK || weapon == 13 || clip == 0 || clip == last_bullet[id])
        return FMRES_IGNORED
    last_bullet[id] = clip           
    if(has_sbullets[id])
        bullet_effect(id, 0)
    return FMRES_IGNORED
}

public zp_extra_item_selected(player, itemid)
{
    if(itemid == g_itemid_silverb)
    {
        new ammo_packs = zp_get_user_ammo_packs(player);
        new price = get_pcvar_num(g_silver_bullets_cost);
        if(ammo_packs > price)
        {
            zp_set_user_ammo_packs(player, ammo_packs - price)
            has_sbullets[player] = 1
            client_print(player, print_chat, "[ZP] You just bought Silver Bullets. Just reload and go!")
        }
        else
            client_print(player, print_chat, "[ZP] You don't have enough ammo packs to buy Silver Bullets.");
    }
}

public Damage(id, inflictor, attacker, Float:damage, Damage_d)
{
    if(~Damage_d & DMG_BULLET)
    if(0 < attacker < 33 && has_sbullets[attacker])
    {
        SetHamParamFloat(4, damage * get_pcvar_float(damage_factor))
        fov_shake(id)
    }   
    return HAM_HANDLED
}

public Spawn(id)
{
    if(is_user_alive(id))
        has_sbullets[id] = 0
    return HAM_HANDLED
}

public bullet_effect(id, num)
{
    new k_origin[3]
    new v_origin[3]
    get_user_origin(id,k_origin, 1)
    get_user_origin(id,v_origin, 4)
    message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0}, id)
    write_byte(0)
    write_coord(k_origin[0])
    write_coord(k_origin[1])
    write_coord(k_origin[2])     //origins ->
    write_coord(v_origin[0])
    write_coord(v_origin[1])
    write_coord(v_origin[2])     //origins <-
    write_short( m_spriteTexture )
    write_byte(1)             // framestart
    write_byte(1)             // framerate
    write_byte(1)             // life in 0.1's
    write_byte(5)             // width
    write_byte(0)              // noise
    write_byte(255)           // r, g, b
    write_byte(255)           // r, g, b
    write_byte(255)           // r, g, b
    write_byte(100)           // brightness
    write_byte(0)            // speed
    message_end()
}

public fov_shake(id)
{
    message_begin(MSG_ONE, fov_value, {0,0,0}, id)
    write_byte(fov_value + 4)
    message_end()
    message_begin( MSG_ONE, shake_value, { 0, 0, 0 }, id)
    write_short(1<<14)
    write_short(1<<12)
    write_short(1<<14)
    message_end()
    set_task(0.4, "un_fov", id)
}

public un_fov(id)
{
    message_begin(MSG_ONE, fov_value, {0,0,0}, id)
    write_byte(fov_value)
    message_end()
}



2. A jak sie nie da to mógłby ktoś przerobić plugin w załączniku, że nie ma srebrnej amunicji tylko jest sama Zatruta.

Załączone pliki


  • +
  • -
  • 0

#2 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1662
Godlike

  • Postów:2495
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Halemba
Offline

Napisano 17.07.2009 14:55

sprawdź
/*
				[ZP] Extra Item : Magic Bullets
				     ( ability for Humans )
					by Fry! & SnoW



	Description :
			Here is new upgraded Magic Bullets. Yea thats right right now there will be 2 types of bullets.
			1) Silver Bullets and 2) Poison Bullets.
			About Silver Bullets :
			When You will buy these Silver Bullets ammos will be different and will be able to do screen shake as well, You will create more damage to victim (can change by cvar).
			About Poison Bullets :
			Strongest ability ever, you can kill zombie very fast by poising him.
			When zombie will posioned he will be slower. All will be possible to change by cvar's.


	Cvars :
			- Silver Bullets
			zp_silver_bullets_damage_factor "1.5"	- How much damage bullets will do.
			zp_silver_bullets_cost "13"		- How much Silver Bullets will cost.
			
			- Poison Bullets
			zp_poison_bullets_mod <1|0>		- Want that zombie could die when will be poisoned? Default is 1.
			zp_poison_bullets_poisondamage "1.0"	- How much HP zombie will loose every second.
			zp_poison_bullets_adddamage "1.3"	- If victim was already poisoned then damage will be multiplied.
			zp_poison_bullets_time "5.0"		- How long does zombie will be posoined.
			zp_poison_bullets_speed "0.8"		- Gets zombie's maxspeed and multiplies it.
			zp_poison_bullets_cost "24"		- How much Poison Bullets cost.
			

	Credits :

			OLO 	- for his Death Info Beams.
			SnoW 	- for his Silver bullets and Poison bullets plugin! <img src='http://amxx.pl/public/style_emoticons/<#EMO_DIR#>/wink.gif' class='bbc_emoticon' alt=';)' />


	Changelog :

			08/01/2009 - v1.0 - First release
			13/02/2009 - v1.0.3 - Added new feature called posion bullets, changed plugin name, removed chat commands.

*/

#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Extra Item : Magic Bullets"
#define VERSION "1.0.3"
#define AUTHOR "Fry! & SnoW"

#define LAST 0
#define FULL 1

new m_spriteTexture, m_spriteTexture2
new damage_factor, damage, poison_time, speed_slow, add_damage, mod
new fov_value, shake_value
new has_sbullets[33], has_pbullets[33], silver_last_bullet[33], poison_last_bullet[33], poisoned[33]
new Float:max_speed
new Float:last_poison[2][33]

new g_item_name1[] = "Silver Bullets"
new g_itemid_silverb, g_silver_bullets_cost

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_cvar("zp_extra_magic_bullets",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
	
	fov_value = get_user_msgid("SetFOV")
	shake_value = get_user_msgid ("ScreenShake")
	
	/* Silver Bullets */
	damage_factor = register_cvar("zp_silver_bullets_damage_factor", "1.5")
	g_silver_bullets_cost = register_cvar("zp_silver_bullets_cost", "13")
	
	/* Poison Bullets */
	mod = register_cvar("zp_poison_bullets_mod", "1")
	damage = register_cvar("zp_poison_bullets_poisondamage", "1.0")
	add_damage = register_cvar("zp_poison_bullets_adddamage", "1.3")
	poison_time = register_cvar("zp_poison_bullets_time", "5.0")
	speed_slow = register_cvar("zp_poison_bullets_speed", "0.8")
	
 
	g_itemid_silverb = zp_register_extra_item(g_item_name1, get_pcvar_num(g_silver_bullets_cost), ZP_TEAM_HUMAN)
	
	
	register_forward(FM_PlayerPreThink, "PreThink")
	register_forward(FM_PlayerPreThink, "PreThink2")
	
	RegisterHam(Ham_TakeDamage, "player", "Damage")
	RegisterHam(Ham_Spawn, "player", "Spawn", 1)		
}

public plugin_precache()
{
	m_spriteTexture = precache_model("sprites/dot.spr")
	m_spriteTexture2 = precache_model("sprites/dot.spr")
}

public PreThink(id)
{
	new weapon, clip, ammo 
	weapon = get_user_weapon(id,clip,ammo)
 
	if(~pev(id, pev_button) & IN_ATTACK || weapon == 13 || clip == 0 || clip == silver_last_bullet[id])
		return FMRES_IGNORED 
			
	if(!has_sbullets[id])
		return FMRES_IGNORED
		
	silver_last_bullet[id] = clip
		
	silver_bullet_effect(id)
	
	return FMRES_IGNORED
}

public PreThink2(id)
{
	new weapon, clip, ammo 
	weapon = get_user_weapon(id,clip,ammo)
	
	if(~pev(id, pev_button) & IN_ATTACK || weapon == 13 || clip == 0 || clip == poison_last_bullet[id])
		return FMRES_IGNORED 	

	if(!has_pbullets[id])
		return FMRES_IGNORED
	
	poison_last_bullet[id] = clip

	poison_bullet_effect(id)
	
	if(poisoned[id])
	{
		new Float:value = get_gametime()
		
		if(value >= last_poison[LAST][id] + 0.5)
		{
			if(value >= last_poison[FULL][id] + get_pcvar_float(poison_time))
			{
				un_poison(id)
			}
		}
		else
		{
			make_dmg(id)
			last_poison[LAST][id] += 0.5
		}
		return FMRES_IGNORED	
	}
	return FMRES_IGNORED
}

public zp_extra_item_selected(player, itemid)
{
	if(itemid == g_itemid_silverb)
	{
		has_sbullets[player] = 1
		silver_bullet_effect(player)
		client_print(player, print_chat, "[ZP] You just bought Silver Bullets. Just reload and go!")
		has_pbullets[player] = 1
		poison_bullet_effect(player)
	}
}

public Damage(id, inflictor, attacker, Float:damage, Damage)
{
	if(!has_sbullets[attacker] || ~Damage & DMG_BULLET)
		return HAM_HANDLED
		
	if(!has_pbullets[attacker] || ~Damage & DMG_BULLET)
		return HAM_HANDLED
		
	SetHamParamFloat(4, damage * get_pcvar_float(damage_factor))
	fov_shake(id)
	
	if(poisoned[id])
	{
		SetHamParamFloat(4, damage * add_damage)
		poison(id)
		fov_shake(id)
	}
	return HAM_HANDLED
}

public Spawn(id)
{
	if(!is_user_alive(id))
		return HAM_HANDLED
	
	has_sbullets[id] = 0
	has_sbullets[id] = 0
	
	if(poisoned[id])
	{
		un_poison(id)
		has_pbullets[id] = 0
	}
	return HAM_HANDLED
}

public poison(id)
{
	if(!poisoned[id])
	{
		pev(id, pev_maxspeed, max_speed)
		poisoned[id] = 1
		last_poison[LAST][id] = get_gametime()
		last_poison[FULL][id] = get_gametime()
		new Float: factor = get_pcvar_float(speed_slow)
		set_pev(id, pev_maxspeed, max_speed * factor)
		set_glow(id, 0.0, 250.0, 10.0)
		make_dmg(id)
	}
}

public make_dmg(id)
{
	new Float: health
	new Float: damage_i = get_pcvar_float(damage)
	pev(id, pev_health, health)
	
	if(get_pcvar_num(mod) == 1)
	{
		if(health - damage_i >= 1.0)
			health -= damage_i
	
		else
			health = 1.0
	}
	else
	{
		health -= damage_i;
		set_pev(id, pev_health, health)
	}	
}

public un_poison(id)
{
	poisoned[id] = 0
	set_pev(id, pev_maxspeed, max_speed)
	set_glow(id, 0.0, 0.0, 0.0)
}

public silver_bullet_effect(id)
{
	new k_origin[3] 
	new v_origin[3]
	get_user_origin(id,k_origin, 1)
	get_user_origin(id,v_origin, 4)
	message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0}, id)
	write_byte(0)
	write_coord(k_origin[0])
	write_coord(k_origin[1])
	write_coord(k_origin[2]) 	//origins ->
	write_coord(v_origin[0]) 
	write_coord(v_origin[1])
	write_coord(v_origin[2]) 	//origins <-
	write_short( m_spriteTexture )
	write_byte(1)	 		// framestart 
	write_byte(1)		 	// framerate 
	write_byte(1) 			// life in 0.1's 
	write_byte(5) 			// width 
	write_byte(0)  			// noise 
	write_byte(255)   		// r, g, b 
	write_byte(255)   		// r, g, b 
	write_byte(255)   		// r, g, b 
	write_byte(100)   		// brightness 
	write_byte(0)    		// speed
	message_end() 
} 

public poison_bullet_effect(id)
{
	new k_origin[3] 
	new v_origin[3]
	get_user_origin(id,k_origin, 1)
	get_user_origin(id,v_origin, 4)
	message_begin(MSG_ONE, SVC_TEMPENTITY,{0,0,0}, id)
	write_byte(0)
	write_coord(k_origin[0])
	write_coord(k_origin[1])
	write_coord(k_origin[2])  	//origins ->
	write_coord(v_origin[0]) 
	write_coord(v_origin[1])
	write_coord(v_origin[2])  	//origins <-
	write_short( m_spriteTexture2 )
	write_byte(1)    		// framestart 
	write_byte(1)    		// framerate 
	write_byte(1)   			// life in 0.1's 
	write_byte(5)    		// width 
	write_byte(0)    		// noise 
	write_byte(0)    		// r, g, b 
	write_byte(255)    		// r, g, b 
	write_byte(10)     		// r, g, b 
	write_byte(100)     		// brightness 
	write_byte(0)      		// speed
	message_end() 
} 

public fov_shake(id)
{
	message_begin(MSG_ONE, fov_value, {0,0,0}, id)
	write_byte(fov_value + 4)
	message_end()
	message_begin( MSG_ONE, shake_value, { 0, 0, 0 }, id)
	write_short(1<<14)
	write_short(1<<12)
	write_short(1<<14)
	message_end()
	set_task(0.4, "un_fov", id)
}

public un_fov(id)
{
	message_begin(MSG_ONE, fov_value, {0,0,0}, id)
	write_byte(fov_value)
	message_end()
}

public set_glow(id, Float:red, Float:green, Float:blue)
{
	set_pev(id, pev_renderfx, kRenderFxGlowShell)
	set_pev(id, pev_rendercolor, red, green, blue)
	set_pev(id, pev_rendermode, kRenderTransAlpha)
	set_pev(id, pev_renderamt, 100.0)
}  

stock get_money(id)
	return get_pdata_int(id, 115, 5)

stock set_money(id, amount, flash=1)
{
	set_pdata_int(id, 115, amount, 5)
	message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id)
	write_long(amount)
	write_byte(flash)
	message_end()
}


  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych