PDA

View Full Version : gasnades


xmdxtremekiller
03-16-2004, 18:52
um i installed the gas nade plugin everything works ok but when some1 dies from the gasnade it counts as suicide for the guy who died from it not a kill for the one who threw the gasnade.what do i have to do :?:

tnsk8er27
03-16-2004, 20:27
um i think thats what its supposed to do

tnsk8er27
03-16-2004, 20:28
you could rewrite it to make it so it counts as a kill :wink:

MagicShot
03-16-2004, 22:31
you could rewrite it to make it so it counts as a kill :wink:

See this...

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

This is a Suggestion by Freecode on Radius Damage.. Would be a good thing to impletement.. :shock:

xmdxtremekiller
03-16-2004, 22:50
it already has radius damage lol

MagicShot
03-16-2004, 22:58
it already has radius damage lol

Your not reading it proporly... :roll:

Not Radus Damaged thats attched to the player that is causing the damage though.. so it counts as a player kill.. thats the whole point of the suggestion.. Yes We know we can do radius damage... but not attach the
:idea:

U get what I am saying now?

tnsk8er27
03-16-2004, 23:06
YEAh listen to magicshot hes my dawg (lol) he knows what hes talkin
about!

GOGO |v|agic$h0t!!!

DoubleTap
03-16-2004, 23:46
Gasnades is one of them sweet plugins I would like to have if it works the SAME way as AMX... if you make it with the same name with different functions I doubt it will be as sweet...

Vic/DT

MagicShot
03-16-2004, 23:59
Gasnades is one of them sweet plugins I would like to have if it works the SAME way as AMX... if you make it with the same name with different functions I doubt it will be as sweet...

Vic/DT

I am just talking about adding the kill count flag identifyer so the player that threw the nade would get credit for damage and kill.. :lol:

xmdxtremekiller
03-17-2004, 00:08
#include <amxmodx>
#include <Vexd_Utilities>

new const SMOKEGRENADE_MODEL[] = "models/w_smokegrenade.mdl"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
register_plugin("Gasgrenades", "1.2", "RichoDemus/AssKicR/T(+)rget")

register_event("TextMsg", "TextMsg", "b", "2&#Game_radio", "4&#Fire_in_the_hole")

register_cvar("amx_gasnades", "1")
register_cvar("amx_gasdmg", "10")
register_cvar("amx_gascheck", "3")
register_cvar("amx_gasradius", "200")
register_cvar("amx_smokegasp", "1")
register_cvar("amx_gasobeyFF", "1")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_sound("player/gasp1.wav")
precache_sound("player/gasp2.wav")
}

public gas(id)
{
new grenadeid
new string[32]
grenadeid = get_grenade(id) // Find a smokegrenade
if(grenadeid > 0)
{
Entvars_Get_String(grenadeid, EV_SZ_model, string, 31)

if(grenadeid && equali(SMOKEGRENADE_MODEL, string)) // If we find the same smokegrenade as the last time
{
new player[3], inum, Float:temp_grenade[3], grenade[3], players[32]
if(get_cvar_num("amx_gasobeyFF") != 1)
get_players(players, inum) // Get number of players

else
{
new FFOn = get_cvar_num("mp_friendlyfire")
if(FFOn == 0)
{
new team[33]
get_user_team(id, team, 32)
if(equali(team, "CT"))
get_players(players, inum, "ae", "TERRORIST")

else
get_players(players, inum, "ae", "CT")
}
else
get_players(players, inum) // Get number of players
}
Entvars_Get_Vector(grenadeid, EV_VEC_origin, temp_grenade) // Get the position of the grenade
grenade[0] = floatround(temp_grenade[0])
grenade[1] = floatround(temp_grenade[1])
grenade[2] = floatround(temp_grenade[2])
for(new i = 0; i < inum; ++i) // Loop through all players
{
get_user_origin(players[i], player) // Get the position of the player
new distance = get_distance(grenade, player)
if((distance < get_cvar_num("amx_gasradius"))) // Check who is standing close
{
if(get_cvar_num("amx_smokegasp") != 0)
{
if(get_cvar_num("amx_gascheck") >= 1)
{
new number = random_num(1, 2)
if(is_user_alive(players[i]))
{
switch (number)
{
case 1:emit_sound(players[i], CHAN_VOICE, "player/gasp1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
case 2:emit_sound(players[i], CHAN_VOICE, "player/gasp2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
}
}
message_begin(MSG_ONE, get_user_msgid("Damage"), {0,0,0}, players[i])
write_byte(30) // dmg_save
write_byte(30) // dmg_take
write_long((1 << 16)) // visibleDamageBits
write_coord(grenade[0]) // damageOrigin.x
write_coord(grenade[1]) // damageOrigin.y
write_coord(grenade[2]) // damageOrigin.z
message_end()
if(is_user_alive(id))
ExtraDamage(players[i], id, get_cvar_num("amx_gasdmg"), "gasgrenade")
}
}
set_task(get_cvar_float("amx_gascheck"), "gas", id) // If the grenade still exists we do a new check in get_cvar_num("amx_gascheck") second
}
}
}
//----------------------------------------------------------------------------------------------
public grenid(id)
{
new string[32], grenadeid
grenadeid = get_grenade(id)
Entvars_Get_String(grenadeid, EV_SZ_model, string, 31)
if(grenadeid && equali(SMOKEGRENADE_MODEL, string))
set_task(0.8, "gas", id)
}
//----------------------------------------------------------------------------------------------
public TextMsg()
{
if(get_cvar_num("amx_gasnades") !=1)
return PLUGIN_HANDLED

new name[32]
read_data(3, name, 31)
new id = get_user_index(name)
set_task(1.0, "grenid", id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
ExtraDamage(id, attacker, damage, weaponDescription[])
{
if(is_user_alive(id))
{
new userHealth = get_user_health(id)
set_user_health(id, userHealth - damage)

if(userHealth - damage <= 0)
{
logKill(attacker, id, weaponDescription)
if(get_user_team(id) != get_user_team(attacker))
{
// The person dying shouldn't get negative credit for this kill (so add it back)
set_user_frags(id, get_user_frags(id) + 1)
// The killing should get credit for the frag
set_user_frags(attacker, get_user_frags(attacker) + 1)
}
else
{
// The person dying shouldn't get negative credit for this kill (so add it back)
set_user_frags(id, get_user_frags(id) + 1)
// The killer killed a teammember or self
// Engine gives credit for the kill so let's take away that + 1
set_user_frags(attacker, get_user_frags(attacker) - 2)
}
}
}
}
//----------------------------------------------------------------------------------------------
/* Log a kill using standard HL-logging format */
logKill(attacker, victim, weaponDescription[])
{
// Save Hummiliation
new namea[24], namev[24], authida[20], authidv[20], teama[10], teamv[10]

// Info On Attacker
get_user_name(attacker, namea, 23)
get_user_team(attacker, teama, 9)
get_user_authid(attacker, authida, 19)
// Info On Victim
get_user_name(victim, namev, 23)
get_user_team(victim, teamv, 9)
get_user_authid(victim, authidv, 19)
// Log This Kill
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",
namea, get_user_userid(attacker), authida, teama, namev, get_user_userid(victim), authidv, teamv, weaponDescription)
}
//----------------------------------------------------------------------------------------------
get_grenade(id)
{
new iGrenade = FindEntity(-1, "grenade")
while(iGrenade > 0)
{
// client_print(id, 2, "Found Entity (Grenade) id %d", iGrenade)
new GrenOwner = Entvars_Get_Edict(iGrenade, EV_ENT_owner)
if(GrenOwner == id)
return iGrenade

iGrenade = FindEntity(iGrenade, "grenade")
}
return 0
}
//----------------------------------------------------------------------------------------------

can you guys fix it cause i dont know how to code :lol:

tnsk8er27
03-17-2004, 00:09
holy shit dude hahaha use tags when your showin plugins thx

tnsk8er27
03-17-2004, 00:12
#include <amxmod>
#include <Vexd_Utilities>

new const SMOKEGRENADE_MODEL[] = "models/w_smokegrenade.mdl"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
register_plugin("Gasgrenades", "1.2", "RichoDemus/AssKicR/T(+)rget")

register_event("TextMsg", "TextMsg", "b", "2&#Game_radio", "4&#Fire_in_the_hole")

register_cvar("amx_gasnades", "1")
register_cvar("amx_gasdmg", "10")
register_cvar("amx_gascheck", "3")
register_cvar("amx_gasradius", "200")
register_cvar("amx_smokegasp", "1")
register_cvar("amx_gasobeyFF", "1")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_sound("player/gasp1.wav")
precache_sound("player/gasp2.wav")
}

public gas(id)
{
new grenadeid
new string[32]
grenadeid = get_grenade(id) // Find a smokegrenade
if(grenadeid > 0)
{
Entvars_Get_String(grenadeid, EV_SZ_model, string, 31)

if(grenadeid && equali(SMOKEGRENADE_MODEL, string)) // If we find the same smokegrenade as the last time
{
new player[3], inum, Float:temp_grenade[3], grenade[3], players[32]
if(get_cvar_num("amx_gasobeyFF") != 1)
get_players(players, inum) // Get number of players

else
{
new FFOn = get_cvar_num("mp_friendlyfire")
if(FFOn == 0)
{
new team[33]
get_user_team(id, team, 32)
if(equali(team, "CT"))
get_players(players, inum, "ae", "TERRORIST")

else
get_players(players, inum, "ae", "CT")
}
else
get_players(players, inum) // Get number of players
}
Entvars_Get_Vector(grenadeid, EV_VEC_origin, temp_grenade) // Get the position of the grenade
grenade[0] = floatround(temp_grenade[0])
grenade[1] = floatround(temp_grenade[1])
grenade[2] = floatround(temp_grenade[2])
for(new i = 0; i < inum; ++i) // Loop through all players
{
get_user_origin(players[i], player) // Get the position of the player
new distance = get_distance(grenade, player)
if((distance < get_cvar_num("amx_gasradius"))) // Check who is standing close
{
if(get_cvar_num("amx_smokegasp") != 0)
{
if(get_cvar_num("amx_gascheck") >= 1)
{
new number = random_num(1, 2)
if(is_user_alive(players[i]))
{
switch (number)
{
case 1:emit_sound(players[i], CHAN_VOICE, "player/gasp1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
case 2:emit_sound(players[i], CHAN_VOICE, "player/gasp2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
}
}
message_begin(MSG_ONE, get_user_msgid("Damage"), {0,0,0}, players[i])
write_byte(30) // dmg_save
write_byte(30) // dmg_take
write_long((1 << 16)) // visibleDamageBits
write_coord(grenade[0]) // damageOrigin.x
write_coord(grenade[1]) // damageOrigin.y
write_coord(grenade[2]) // damageOrigin.z
message_end()
if(is_user_alive(id))
ExtraDamage(players[i], id, get_cvar_num("amx_gasdmg"), "gasgrenade")
}
}
set_task(get_cvar_float("amx_gascheck"), "gas", id) // If the grenade still exists we do a new check in get_cvar_num("amx_gascheck") second
}
}
}
//----------------------------------------------------------------------------------------------
public grenid(id)
{
new string[32], grenadeid
grenadeid = get_grenade(id)
Entvars_Get_String(grenadeid, EV_SZ_model, string, 31)
if(grenadeid && equali(SMOKEGRENADE_MODEL, string))
set_task(0.8, "gas", id)
}
//----------------------------------------------------------------------------------------------
public TextMsg()
{
if(get_cvar_num("amx_gasnades") !=1)
return PLUGIN_HANDLED

new name[32]
read_data(3, name, 31)
new id = get_user_index(name)
set_task(1.0, "grenid", id)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
ExtraDamage(id, attacker, damage, weaponDescription[])
{
if(is_user_alive(id))
{
new userHealth = get_user_health(id)
set_user_health(id, userHealth - damage)

if(userHealth - damage <= 0)
{
logKill(attacker, id, weaponDescription)
if(get_user_team(id) != get_user_team(attacker))
{
// The person dying shouldn't get negative credit for this kill (so add it back)
set_user_frags(id, get_user_frags(id) + 1)
// The killing should get credit for the frag
set_user_frags(attacker, get_user_frags(attacker) + 1)
}
else
{
// The person dying shouldn't get negative credit for this kill (so add it back)
set_user_frags(id, get_user_frags(id) + 1)
// The killer killed a teammember or self
// Engine gives credit for the kill so let's take away that + 1
set_user_frags(attacker, get_user_frags(attacker) - 2)
}
}
}
}
//----------------------------------------------------------------------------------------------
/* Log a kill using standard HL-logging format */
logKill(attacker, victim, weaponDescription[])
{
// Save Hummiliation
new namea[24], namev[24], authida[20], authidv[20], teama[10], teamv[10]

// Info On Attacker
get_user_name(attacker, namea, 23)
get_user_team(attacker, teama, 9)
get_user_authid(attacker, authida, 19)
// Info On Victim
get_user_name(victim, namev, 23)
get_user_team(victim, teamv, 9)
get_user_authid(victim, authidv, 19)
// Log This Kill
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",
namea, get_user_userid(attacker), authida, teama, namev, get_user_userid(victim), authidv, teamv, weaponDescription)
}
//----------------------------------------------------------------------------------------------
get_grenade(id)
{
new iGrenade = FindEntity(-1, "grenade")
while(iGrenade > 0)
{
// client_print(id, 2, "Found Entity (Grenade) id %d", iGrenade)
new GrenOwner = Entvars_Get_Edict(iGrenade, EV_ENT_owner)
if(GrenOwner == id)
return iGrenade

iGrenade = FindEntity(iGrenade, "grenade")
}
return 0
}
//----------------------------------------------------------------------------------------------

there ya guys go

DoubleTap
03-17-2004, 00:20
This is one of them weird plugins from AMX where folks complained or whatever... but I changed some of the numbers for my server and it is absolutely an awesome plugin... hurts like hell if ya camp but hurts only a tad if you move your feet :) I ONLY remove it for CAL now... hehehe... them T's on Italy camping the house now finally have an equalizer :)

Vic/DT

tnsk8er27
03-17-2004, 00:25
yeah sounds pretty cool, another cool plugin i saw on my friends server is where if you teamsay "getclothes" over a corpes it will get there clothes..sorta like a disguise....i thought it was pretty neat and im thinkin about modifying it a little and passing it over to amxmodx.

DoubleTap
03-17-2004, 00:28
I can hear the cries of hacking now.... 8)

tnsk8er27
03-17-2004, 00:29
lol i know everyone who came in was like KICK him hes using a glitch

MagicShot
03-17-2004, 01:26
I can hear the cries of hacking now.... 8)

LOL.. :twisted:

xmdxtremekiller
03-17-2004, 10:10
I get this error message and it doesnt finish compiling it.

xmdxtremekiller
03-22-2004, 17:39
help :roll:

xmdxtremekiller
03-22-2004, 17:41
Small compiler 2.1.0 Copyright (c) 1997-2002, ITB CompuPhase

/home/users/amxmodx/tmp/phpfIQKQp.sma(125) : error 017: undefined symbol "set_user_health"
/home/users/amxmodx/tmp/phpfIQKQp.sma(168) : error 021: symbol already defined: "get_grenade"

2 Errors.
and website compiler does this too
but i get this error when only changing the inc to amxmodx.inc
/home/users/amxmodx/tmp/phpfIQKQp.sma(125) : error 017: undefined symbol "set_user_health"

DopeFish
03-23-2004, 02:44
rewrote for amxx
http://forums.alliedmods.net/showthread.php?t=425

rex
03-23-2004, 18:20
yeah sounds pretty cool, another cool plugin i saw on my friends server is where if you teamsay "getclothes" over a corpes it will get there clothes..sorta like a disguise....i thought it was pretty neat and im thinkin about modifying it a little and passing it over to amxmodx.


really fun plugin tnsk8er27 hope you modify it soon, as i can't run it now on amxx

i have attached the old file incase you don't have it
looking foward to your modifyed version

godly
10-30-2005, 19:09
i cant get the smoke nades to work i have everything in the right place and he first map it worked then nothingb..... help me :(

rex
10-30-2005, 19:55
tell us abit about your system mate.
eg win or linux
is the plugin running when you type amxx plugins in the console
what version of amxx are you running.
anything else that may be helpful

godly
10-31-2005, 03:34
im running the latest version of amxx and its linux and it says plugin is running i dont know wot else to do :oops:

rex
11-01-2005, 04:52
i'll have to leave it for someone else mate, i don't know much about linux, only windows, sorry.
but hopefully someone else can help you.