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

Anti GasNades


  • Zamknięty Temat jest zamknięty
9 odpowiedzi w tym temacie

#1 PEREF

    Profesjonalista

  • Zbanowany

Reputacja: 27
Życzliwy

  • Postów:201
  • GG:
Offline

Napisano 07.07.2008 13:38

Witam. Jest ktoś w stanie na tym forum napisać plugin, dzięki któremu po wpisaniu /maska otrzymujemy maskę gazową za xxx$. Chroni ona nas przed duszącym smoke...
Plugin ten jest na serwerze Puchatka, ale niestety Seba jak na razie nie ma zamiaru udostępnić pluginu http://amxx.pl/public/style_emoticons/default/beksa.gif

Pozdrawiam.

#2 mloddyy

    Początkujący

  • Użytkownik

Reputacja: 1
Nowy

  • Postów:12
Offline

Napisano 07.07.2008 19:28

maska, maska hmmm, z modelem? czy bez?
  • +
  • -
  • 0

#3 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 07.07.2008 23:28

pffffff proscizna daj mi linka do pluginu a jutro to napisze ^.^ bo modyfikacje dotyczace konkretnego dzialania pluga trzeba robic w tym plugu, nie osobno

no wlasnie przydalby sie model maski, no ale na tym puchoczu chyba nie ma tego ? wiec tak czy siak bedziesz mial to samo

//wiec napisz dokladnie czego oczekujesz po tej modyfikacji i tyle, czy kasa ma byc okreslana cvarem, czy od razu wklepana, tzw 'hardcoded' czy co i tyle
  • +
  • -
  • 0

#4 PEREF

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 27
Życzliwy

  • Postów:201
  • GG:
Offline

Napisano 08.07.2008 02:08

Jeśli chodzi o cvary to chyba 2 stykną:

- plugin on/off
- koszt maski gazowej

trzymaj sma ;)

/* AMX Mod X Plugin
* 
* (c) Copyright 2007, ConnorMcLeod 
* This file is provided as is (no warranties). 
* 
*/
 
/* http://forums.alliedmods.net/showthread.php?t=60947
*
* Changelog
* v1.6
* now when a player dies, nade's owner gets a frag
* don't make death msgs if another plugin block those messages
* v1.5b
* -little optimization ( get_gametime was used more than 1 time in few functions )
* -error fix in entity think forward, now check first if entity is valid
* -added a public cvar
* -little changes/cleanup
* v1.5a
* -amx_gas_restore now works according to cvars amx_gascheck and amx_gasdmg
* v1.5
* -added cvar amx_gas_restore that allow to restore players HP
* v1.4b
* -fixed plugin didn't work correctly with mp_friendlyfire
* -little optimization
* v1.4
* -Almost completly rewrote the plugin
*/

#include <amxmodx> 
#include <fakemeta>

#define VERSION	"1.6"

#if AMXX_VERSION_NUM < 180
	#define charsmax(%1)	sizeof(%1) - 1
#endif

#define OFFSET_CSDEATHS		444
#define OFFSET_TEAM			114

#define GASP_SOUND1 		"player/gasp1.wav"
#define GASP_SOUND2 		"player/gasp2.wav"

#define SMOKEGRENADE_SOUND 	"weapons/sg_explode.wav"
#define GAS_CLASSNAME 		"gasgrenade"
#define GASNADE_LIFE 		25.0

new amx_gasnades, amx_gasdmg, amx_gascheck, amx_gasradius, amx_smokegasp, amx_gasobeyFF, amx_gas_restore
new mp_friendlyfire

new gmsgDamage, gmsgDeathMsg, gmsgScoreInfo

new Float:player_affected_time[33]
new Float:player_restored_time[33]
new Float:damage_took[33]

public plugin_precache()
{ 
	engfunc(EngFunc_PrecacheSound, GASP_SOUND1)
	engfunc(EngFunc_PrecacheSound, GASP_SOUND2)
}

public plugin_init()
{
	register_plugin("Gas Grenades", VERSION, "ConnorMcLeod") //  RichoDemus/AssKicR/T(+)rget for previous versions

	register_event("HLTV", "eNewRound", "a", "1=0", "2=0")

	register_forward(FM_EmitSound, "fwdEmitSound")
	register_forward(FM_Touch, "fwdTouch")
	register_forward(FM_Think, "fwdThink")
	register_forward(FM_PlayerPreThink, "fwdPlayerPreThink")

	register_cvar("gasnade", VERSION, FCVAR_SERVER)

	amx_gasnades = register_cvar("amx_gasnades",       "1") 		// 0/1 Disable/Enable the whole plugin

	amx_gasdmg =      register_cvar("amx_gasdmg",      "2") 		// How much damage the player takes every check cycle, 0 to disable damage (see amx_gascheck)
	amx_gascheck =    register_cvar("amx_gascheck",    "2") 		// Check period in seconds
	amx_gasradius =   register_cvar("amx_gasradius",   "180") 		// Smoke Radius (best is 170 - 230)
	amx_smokegasp =   register_cvar("amx_smokegasp",   "1") 		// 0/1 Makes players gasp/cough in smoke
	amx_gasobeyFF =   register_cvar("amx_gasobeyFF",   "0") 		// 0/1 Makes plugin act or not as cvar mp_friendlyfire
	amx_gas_restore = register_cvar("amx_gas_restore", "1") 		// 0/1 Restore or not HP (if amx_gasdmg > 0)
}

public plugin_cfg()
{
	mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")

	gmsgDamage = get_user_msgid("Damage")
	gmsgDeathMsg = get_user_msgid("DeathMsg")
	gmsgScoreInfo = get_user_msgid("ScoreInfo")
}

public client_connect(id) {
	new Float:global_Time
	global_get(glb_time, global_Time)
	player_affected_time[id] = global_Time
	player_restored_time[id] = global_Time
	damage_took[id] = 0.0
}

public eNewRound() {
	new ent = -1
	while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", GAS_CLASSNAME)) > 0) {
		engfunc(EngFunc_RemoveEntity, ent)
	}
	new Float:global_Time
	global_get(glb_time, global_Time)
	new players[32], inum, player
	get_players(players, inum)
	for(new i; i<inum; i++) {
		player = players[i]
		player_affected_time[player] = global_Time
		player_restored_time[player] = global_Time
		damage_took[player] = 0.0
	}
}

public fwdPlayerPreThink(id) {
	if(!get_pcvar_num(amx_gasnades))
		return FMRES_IGNORED

	static Float:gasdmg
	gasdmg = get_pcvar_float(amx_gasdmg)
	if( !gasdmg && !get_pcvar_num(amx_gas_restore) )
		return FMRES_IGNORED
	
	if( !is_user_alive(id) || !is_user_connected(id) )
		return FMRES_IGNORED
	
	// check if player has HPs to be set back
	static Float:damage_to_restore
	damage_to_restore = damage_took[id]
	if( damage_to_restore < 1.0 )
		return FMRES_IGNORED

	static Float:global_Time
	global_get(glb_time, global_Time)

	static Float:cycle
	cycle = get_pcvar_float(amx_gascheck)

	// should tell if player is still in smoke
	if( global_Time - player_affected_time[id] < cycle + 0.1 )
		return FMRES_IGNORED
	
	if( global_Time - player_restored_time[id] < cycle )
		return FMRES_IGNORED
	
	static Float:userHealth
	pev(id, pev_health, userHealth)
	
	if( damage_to_restore >= gasdmg) {
		set_pev(id, pev_health, userHealth + gasdmg)
		damage_took[id] -= gasdmg
		
	}
	else if( damage_to_restore > 0.0 ) { //shouldn't happen unless an admin change some cvars during a round
		set_pev(id, pev_health, userHealth + damage_to_restore)
		damage_took[id] -= damage_to_restore
	}
	
	player_restored_time[id] = global_Time

	return FMRES_HANDLED
}

public fwdEmitSound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch)
{
	if(!get_pcvar_num(amx_gasnades))
		return FMRES_IGNORED

	if(!equali(sample, SMOKEGRENADE_SOUND))
		return FMRES_IGNORED
	
	static owner
	owner = pev(entity, pev_owner)
	
	static Float:origin[3]
	pev(entity, pev_origin, origin)
	
	static ent
	ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	set_pev(ent, pev_classname, GAS_CLASSNAME)
	set_pev(ent,pev_solid,SOLID_TRIGGER)

	static Float:radius, Float:min_rad[3], Float:max_rad[3]
	radius = get_pcvar_float(amx_gasradius)
	min_rad[0] = -radius
	min_rad[1] = -radius
	min_rad[2] = -radius
	max_rad[0] = radius
	max_rad[1] = radius
	max_rad[2] = radius

	engfunc(EngFunc_SetSize, ent, min_rad, max_rad)

	set_pev(ent, pev_owner, owner) // cvar amx_gasobeyFF
	engfunc(EngFunc_SetOrigin,ent,origin)

	new Float:global_Time
	global_get(glb_time, global_Time)
	set_pev(ent, pev_nextthink, global_Time + GASNADE_LIFE)

	return FMRES_HANDLED
}

public fwdThink(ent) {
	if(!pev_valid(ent))
		return FMRES_IGNORED

	static classname[33]
	pev(ent, pev_classname, classname, charsmax(classname))

	if(!equal(classname,GAS_CLASSNAME))
		return FMRES_IGNORED

	engfunc(EngFunc_RemoveEntity, ent)
	return FMRES_HANDLED
}

public fwdTouch(ent, id) {
	if(!is_user_alive(id) || !is_user_connected(id))
		return FMRES_IGNORED
	if(!pev_valid(ent)) {
		return FMRES_IGNORED
	}
	static classname[33]
	pev(ent, pev_classname, classname, charsmax(classname))
	if(!equal(classname, GAS_CLASSNAME))
		return FMRES_IGNORED

	new Float:global_Time
	global_get(glb_time, global_Time)

	if( global_Time - player_affected_time[id] < get_pcvar_float(amx_gascheck) )
		return FMRES_IGNORED

	static owner
	owner = pev(ent, pev_owner)
	if( !get_pcvar_num(mp_friendlyfire) && get_pcvar_num(amx_gasobeyFF) && get_pdata_int(id, OFFSET_TEAM) == get_pdata_int(owner, OFFSET_TEAM) )
		return FMRES_IGNORED

	player_affected_time[id] = global_Time
	msg_damage(id, ent)

	if(get_pcvar_num(amx_smokegasp))
	{
		switch (random_num(1, 2))
		{
			case 1: emit_sound(id, CHAN_VOICE, GASP_SOUND1, 1.0, ATTN_NORM, 0, PITCH_NORM)
			case 2: emit_sound(id, CHAN_VOICE, GASP_SOUND2, 1.0, ATTN_NORM, 0, PITCH_NORM)
		}
	}

	static Float:damage
	damage = get_pcvar_float(amx_gasdmg)
	if(damage > 0.0) {
		ExtraDamage(id, owner, damage, GAS_CLASSNAME)
		if(get_pcvar_num(amx_gas_restore))
		{
			damage_took[id] += damage
		}
	}

	return FMRES_HANDLED
}

ExtraDamage(id, attacker, Float:damage, weaponDescription[])
{
	if(is_user_alive(id)) 
	{
		static Float:userHealth
		pev(id, pev_health, userHealth)

		if(userHealth - damage < 1.0)
		{
			if(!is_user_connected(attacker))
				attacker = 0

			add_frags(id, 1.0)

			new msgblock = get_msg_block(gmsgDeathMsg)
			if(msgblock != BLOCK_SET)
			{
				set_msg_block(gmsgDeathMsg, BLOCK_ONCE)
				make_deathmsg ( attacker, id, 0, weaponDescription )
				dllfunc(DLLFunc_ClientKill, id)
				set_msg_block(gmsgDeathMsg, msgblock)
			}
			else
				dllfunc(DLLFunc_ClientKill, id)

			if(attacker && attacker != id)
			{
				if( get_pdata_int(id, OFFSET_TEAM) != get_pdata_int(attacker, OFFSET_TEAM) )
					add_frags(attacker, 1.0)
				else if( get_pcvar_num(mp_friendlyfire) )
					add_frags(attacker, -1.0)
			}
		}
		else
		{
			set_pev(id, pev_health, userHealth - damage)
		}
	}
}

add_frags(id, Float:amount) {
	static Float:frags, Float:newfrags
	pev(id, pev_frags, frags)
	newfrags = amount + frags
	set_pev(id, pev_frags, newfrags)

	message_begin( MSG_ALL , gmsgScoreInfo ) 
	write_byte( id ) 
	write_short( floatround( newfrags ) ) 
	write_short( get_pdata_int(id, OFFSET_CSDEATHS) ) 
	write_short( 0 ) 
	write_short( get_pdata_int(id, OFFSET_TEAM) ) 
  	message_end()
}

msg_damage(id, entity) {

	static Float:origin[3]
	pev(entity, pev_origin, origin)

	message_begin(MSG_ONE, gmsgDamage, _, id)
	write_byte(30) // dmg_save
	write_byte(30) // dmg_take

	write_long(DMG_SLOWFREEZE) // visibleDamageBits  //DMG_ACID , //

	engfunc(EngFunc_WriteCoord, origin[0])  //arkshine
	engfunc(EngFunc_WriteCoord, origin[1])
	engfunc(EngFunc_WriteCoord, origin[2])

	message_end()
}


[ Dodano: 08-07-2008, 15:52 ]
Plugin bez żadnego modelu, po prostu typ który kupi maskę ma być odporny na smoke (nie kaszleć, tracić HP) ;)

#5 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 09.07.2008 02:05

/* AMX Mod X Plugin

*

* (c) Copyright 2007, ConnorMcLeod

* This file is provided as is (no warranties).

*

*/

 

/* http://forums.alliedmods.net/showthread.php?t=60947

*

* Changelog

* v1.6

* now when a player dies, nade's owner gets a frag

* don't make death msgs if another plugin block those messages

* v1.5b

* -little optimization ( get_gametime was used more than 1 time in few functions )

* -error fix in entity think forward, now check first if entity is valid

* -added a public cvar

* -little changes/cleanup

* v1.5a

* -amx_gas_restore now works according to cvars amx_gascheck and amx_gasdmg

* v1.5

* -added cvar amx_gas_restore that allow to restore players HP

* v1.4b

* -fixed plugin didn't work correctly with mp_friendlyfire

* -little optimization

* v1.4

* -Almost completly rewrote the plugin

*/



#include <amxmodx>

#include <cstrike>

#include <fakemeta>



#define VERSION    "1.6"



#if AMXX_VERSION_NUM < 180

    #define charsmax(%1)    sizeof(%1) - 1

#endif



#define OFFSET_CSDEATHS        444

#define OFFSET_TEAM            114



#define GASP_SOUND1         "player/gasp1.wav"

#define GASP_SOUND2         "player/gasp2.wav"



#define SMOKEGRENADE_SOUND     "weapons/sg_explode.wav"

#define GAS_CLASSNAME         "gasgrenade"

#define GASNADE_LIFE         25.0



new amx_gasnades, amx_gasdmg, amx_gascheck, amx_gasradius, amx_smokegasp, amx_gasobeyFF, amx_gas_restore, amx_gas_maskcost, amx_gas_maskon

new mp_friendlyfire



new gmsgDamage, gmsgDeathMsg, gmsgScoreInfo



new Float:player_affected_time[33]

new Float:player_restored_time[33]

new Float:damage_took[33]

new bool:has_mask[33]



public plugin_precache()

{

    engfunc(EngFunc_PrecacheSound, GASP_SOUND1)

    engfunc(EngFunc_PrecacheSound, GASP_SOUND2)

}



public plugin_init()

{

    register_plugin("Gas Grenades", VERSION, "ConnorMcLeod") //  RichoDemus/AssKicR/T(+)rget for previous versions



    register_event("HLTV", "eNewRound", "a", "1=0", "2=0")



    register_forward(FM_EmitSound, "fwdEmitSound")

    register_forward(FM_Touch, "fwdTouch")

    register_forward(FM_Think, "fwdThink")

    register_forward(FM_PlayerPreThink, "fwdPlayerPreThink")

    register_event("DeathMsg", "player_death", "a")

    register_clcmd("say /maska", "mask")



    register_cvar("gasnade", VERSION, FCVAR_SERVER)



    amx_gasnades = register_cvar("amx_gasnades",       "1")         // 0/1 Disable/Enable the whole plugin



    amx_gasdmg =      register_cvar("amx_gasdmg",      "2")         // How much damage the player takes every check cycle, 0 to disable damage (see amx_gascheck)

    amx_gascheck =    register_cvar("amx_gascheck",    "2")         // Check period in seconds

    amx_gasradius =   register_cvar("amx_gasradius",   "180")         // Smoke Radius (best is 170 - 230)

    amx_smokegasp =   register_cvar("amx_smokegasp",   "1")         // 0/1 Makes players gasp/cough in smoke

    amx_gasobeyFF =   register_cvar("amx_gasobeyFF",   "0")         // 0/1 Makes plugin act or not as cvar mp_friendlyfire

    amx_gas_restore = register_cvar("amx_gas_restore", "1")         // 0/1 Restore or not HP (if amx_gasdmg > 0)

    amx_gas_maskon = register_cvar("amx_gas_maskon", "1")

    amx_gas_maskcost = register_cvar("amx_gas_maskcost", "500")

}



public plugin_cfg()

{

    mp_friendlyfire = get_cvar_pointer("mp_friendlyfire")



    gmsgDamage = get_user_msgid("Damage")

    gmsgDeathMsg = get_user_msgid("DeathMsg")

    gmsgScoreInfo = get_user_msgid("ScoreInfo")

}



public mask(id)

{

 if(!is_user_alive(id) && get_pcvar_num(amx_gas_maskon))

  {

   client_print(id, print_chat, "nie zyjesz")

  }

 if(has_mask[id])

  {

   client_print(id, print_chat, "masz maske")

  }

 if(cs_get_user_money(id) < get_pcvar_num(amx_gas_maskcost) && get_pcvar_num(amx_gas_maskon) && !has_mask[id])

  {

   client_print(id, print_chat, "nie masz kasy")

  }

 if(is_user_alive(id) && get_pcvar_num(amx_gas_maskon) && cs_get_user_money(id) >= get_pcvar_num(amx_gas_maskcost) && !has_mask[id])

  {

   cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(amx_gas_mascost))

   client_print(id, print_chat, "kupiles maske")

   has_mask[id] = true

  }

}



public player_death()

{

 new id = read_data(2)



 has_mask[id] = false

}



public client_connect(id) {

    new Float:global_Time

    global_get(glb_time, global_Time)

    player_affected_time[id] = global_Time

    player_restored_time[id] = global_Time

    damage_took[id] = 0.0

}



public eNewRound() {

    new ent = -1

    while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", GAS_CLASSNAME)) > 0) {

        engfunc(EngFunc_RemoveEntity, ent)

    }

    new Float:global_Time

    global_get(glb_time, global_Time)

    new players[32], inum, player

    get_players(players, inum)

    for(new i; i<inum; i++) {

        player = players[i]

        player_affected_time[player] = global_Time

        player_restored_time[player] = global_Time

        damage_took[player] = 0.0

    }

}



public fwdPlayerPreThink(id) {

    if(!get_pcvar_num(amx_gasnades))

        return FMRES_IGNORED



    static Float:gasdmg

    gasdmg = get_pcvar_float(amx_gasdmg)

    if( !gasdmg && !get_pcvar_num(amx_gas_restore) )

        return FMRES_IGNORED

   

    if( !is_user_alive(id) || !is_user_connected(id))

        return FMRES_IGNORED

   

    // check if player has HPs to be set back

    static Float:damage_to_restore

    damage_to_restore = damage_took[id]

    if( damage_to_restore < 1.0 )

        return FMRES_IGNORED



    static Float:global_Time

    global_get(glb_time, global_Time)



    static Float:cycle

    cycle = get_pcvar_float(amx_gascheck)



    // should tell if player is still in smoke

    if( global_Time - player_affected_time[id] < cycle + 0.1 )

        return FMRES_IGNORED

   

    if( global_Time - player_restored_time[id] < cycle )

        return FMRES_IGNORED

   

    static Float:userHealth

    pev(id, pev_health, userHealth)

   

    if( damage_to_restore >= gasdmg) {

        set_pev(id, pev_health, userHealth + gasdmg)

        damage_took[id] -= gasdmg

       

    }

    else if( damage_to_restore > 0.0 ) { //shouldn't happen unless an admin change some cvars during a round

        set_pev(id, pev_health, userHealth + damage_to_restore)

        damage_took[id] -= damage_to_restore

    }

   

    player_restored_time[id] = global_Time



    return FMRES_HANDLED

}



public fwdEmitSound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch)

{

    if(!get_pcvar_num(amx_gasnades))

        return FMRES_IGNORED



    if(!equali(sample, SMOKEGRENADE_SOUND))

        return FMRES_IGNORED

   

    static owner

    owner = pev(entity, pev_owner)

   

    static Float:origin[3]

    pev(entity, pev_origin, origin)

   

    static ent

    ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))

    set_pev(ent, pev_classname, GAS_CLASSNAME)

    set_pev(ent,pev_solid,SOLID_TRIGGER)



    static Float:radius, Float:min_rad[3], Float:max_rad[3]

    radius = get_pcvar_float(amx_gasradius)

    min_rad[0] = -radius

    min_rad[1] = -radius

    min_rad[2] = -radius

    max_rad[0] = radius

    max_rad[1] = radius

    max_rad[2] = radius



    engfunc(EngFunc_SetSize, ent, min_rad, max_rad)



    set_pev(ent, pev_owner, owner) // cvar amx_gasobeyFF

    engfunc(EngFunc_SetOrigin,ent,origin)



    new Float:global_Time

    global_get(glb_time, global_Time)

    set_pev(ent, pev_nextthink, global_Time + GASNADE_LIFE)



    return FMRES_HANDLED

}



public fwdThink(ent) {

    if(!pev_valid(ent))

        return FMRES_IGNORED



    static classname[33]

    pev(ent, pev_classname, classname, charsmax(classname))



    if(!equal(classname,GAS_CLASSNAME))

        return FMRES_IGNORED



    engfunc(EngFunc_RemoveEntity, ent)

    return FMRES_HANDLED

}



public fwdTouch(ent, id) {

    if(!is_user_alive(id) || !is_user_connected(id))

        return FMRES_IGNORED

    if(!pev_valid(ent)) {

        return FMRES_IGNORED

    }

    static classname[33]

    pev(ent, pev_classname, classname, charsmax(classname))

    if(!equal(classname, GAS_CLASSNAME))

        return FMRES_IGNORED



    new Float:global_Time

    global_get(glb_time, global_Time)



    if( global_Time - player_affected_time[id] < get_pcvar_float(amx_gascheck) )

        return FMRES_IGNORED



    static owner

    owner = pev(ent, pev_owner)

    if( !get_pcvar_num(mp_friendlyfire) && get_pcvar_num(amx_gasobeyFF) && get_pdata_int(id, OFFSET_TEAM) == get_pdata_int(owner, OFFSET_TEAM) )

        return FMRES_IGNORED



    player_affected_time[id] = global_Time

    msg_damage(id, ent)



    if(get_pcvar_num(amx_smokegasp) && !has_mask[id])

    {

        switch (random_num(1, 2))

        {

            case 1: emit_sound(id, CHAN_VOICE, GASP_SOUND1, 1.0, ATTN_NORM, 0, PITCH_NORM)

            case 2: emit_sound(id, CHAN_VOICE, GASP_SOUND2, 1.0, ATTN_NORM, 0, PITCH_NORM)

        }

    }



    static Float:damage

    damage = get_pcvar_float(amx_gasdmg)

    if(damage > 0.0) {

        ExtraDamage(id, owner, damage, GAS_CLASSNAME)

        if(get_pcvar_num(amx_gas_restore))

        {

            damage_took[id] += damage

        }

    }



    return FMRES_HANDLED

}



ExtraDamage(id, attacker, Float:damage, weaponDescription[])

{

    if(is_user_alive(id))

    {

        static Float:userHealth

        pev(id, pev_health, userHealth)



        if(userHealth - damage < 1.0 && !has_mask[id])

        {

            if(!is_user_connected(attacker))

                attacker = 0



            add_frags(id, 1.0)



            new msgblock = get_msg_block(gmsgDeathMsg)

            if(msgblock != BLOCK_SET)

            {

                set_msg_block(gmsgDeathMsg, BLOCK_ONCE)

                make_deathmsg ( attacker, id, 0, weaponDescription )

                dllfunc(DLLFunc_ClientKill, id)

                set_msg_block(gmsgDeathMsg, msgblock)

            }

            else

                dllfunc(DLLFunc_ClientKill, id)



            if(attacker && attacker != id)

            {

                if( get_pdata_int(id, OFFSET_TEAM) != get_pdata_int(attacker, OFFSET_TEAM) )

                    add_frags(attacker, 1.0)

                else if( get_pcvar_num(mp_friendlyfire) )

                    add_frags(attacker, -1.0)

            }

        }

        else

        {

            if(!has_mask[id])

              set_pev(id, pev_health, userHealth - damage)

        }

    }

}



add_frags(id, Float:amount) {

    static Float:frags, Float:newfrags

    pev(id, pev_frags, frags)

    newfrags = amount + frags

    set_pev(id, pev_frags, newfrags)



    message_begin( MSG_ALL , gmsgScoreInfo )

    write_byte( id )

    write_short( floatround( newfrags ) )

    write_short( get_pdata_int(id, OFFSET_CSDEATHS) )

    write_short( 0 )

    write_short( get_pdata_int(id, OFFSET_TEAM) )

      message_end()

}



msg_damage(id, entity) {



   static Float:origin[3]

   pev(entity, pev_origin, origin)



   if(!has_mask[id])

   {

    message_begin(MSG_ONE, gmsgDamage, _, id)

    write_byte(30) // dmg_save

    write_byte(30) // dmg_take



    write_long(DMG_SLOWFREEZE) // visibleDamageBits  //DMG_ACID , //



    engfunc(EngFunc_WriteCoord, origin[0])  //arkshine

    engfunc(EngFunc_WriteCoord, origin[1])

    engfunc(EngFunc_WriteCoord, origin[2])



    message_end()

   }

}

  • +
  • -
  • 0

#6 PEREF

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 27
Życzliwy

  • Postów:201
  • GG:
Offline

Napisano 09.07.2008 16:38

plugin się skompilował z 1 błędem:

/home/groups/amxmodx/tmp3/phpZHBa3L.sma(358) : warning 217: loose indentation


#7 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 09.07.2008 17:13

gdzies ze spacjami jest nie tak, juz tak mamy z tym ['code]
  • +
  • -
  • 0

#8 PEREF

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 27
Życzliwy

  • Postów:201
  • GG:
Offline

Napisano 09.07.2008 18:19

maska też nie działa :/

jest informacja, że qpiłem maskę, ale będąc w smoke tracę HP

#9 Salamon

    Profesjonalista

  • Użytkownik

Reputacja: 43
Pomocny

  • Postów:199
Offline

Napisano 10.07.2008 14:22

sry moj blad teraz dziala ^_^ (zedytowalem)
  • +
  • -
  • 0

#10 PEREF

    Profesjonalista

  • Autor tematu
  • Zbanowany

Reputacja: 27
Życzliwy

  • Postów:201
  • GG:
Offline

Napisano 11.07.2008 03:10

OK działa. ThX ;)




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

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