Raised This Month: $51 Target: $400
 12% 

Massive error output?


Post New Thread Reply   
 
Thread Tools Display Modes
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-15-2011 , 15:24   Re: Massive error output?
Reply With Quote #11

new Float:fl_vExplodeAt[SH_MAXSLOTS+1][3]

You only fill one of them when you use it in your code. [][] not [].
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 02-15-2011 , 15:46   Re: Massive error output?
Reply With Quote #12

Quote:
Originally Posted by Jelle View Post
Index the arrays dude.
No.
__________________
The Art of War is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 02-15-2011 , 15:48   Re: Massive error output?
Reply With Quote #13

You have new Float:fl_vExplodeAt[SH_MAXSLOTS+1][3] but you never index them.

You need to index the first. I guess you want to set it for each player by using a player index.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 02-16-2011 , 02:26   Re: Massive error output?
Reply With Quote #14

Cant get past the tag mismatches on the sh_extra_damage, and now I also get it on new Float:distanceBetween

PHP Code:
public fm_Touch(ptrptd)
{
    if ( !
sh_is_active() ) return FMRES_IGNORED
    
if ( !pev_valid(ptr) ) return FMRES_IGNORED
    
    
static classname[32]
    
classname[0] = '^0'
    
pev(ptrpev_classnameclassnamecharsmax(classname))

    if( 
equal(classnamegPowerClass) ) {
        new 
id pev(ptrpev_owner)

        
client_print(idprint_console"classnames, floats")
        
        
pev(ptrpev_originfl_vExplodeAt[id])

        new 
players[SH_MAXSLOTS], playerCountvictim
        get_players
(playersplayerCount"ah")

        for ( new 
0playerCounti++ ) {
            
victim players[i]
            
            
client_print(idprint_console"Poison Gas Task")
            
            new 
parm[3]
            
parm[0] = victim
            parm
[1] = ptr
            parm
[2] = id
                
            set_task
(get_pcvar_float(pCvarTime), "poison"_parm3"a"40)
        }


        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()

        
emit_sound(ptrCHAN_WEAPONgSoundExplodeVOL_NORMATTN_NORM0PITCH_NORM)

        
engfunc(EngFunc_RemoveEntityptr)
    }

    return 
FMRES_IGNORED
}

public 
poison(parm[])    
{
    
    new 
victim parm[0]
    new 
ptr parm[1]
    new 
id parm[2]
    
    
client_print(idprint_console"Poison forward, classnames, id")

    new 
Float:maxDamage get_pcvar_num(pCvarMaxDamage)
    new 
Float:distanceBetween
    
new Float:dmgRadius get_pcvar_float(pCvarRadius)
    new 
FFOn sh_friendlyfire_on()
    new 
CsTeams:idTeam cs_get_user_team(id)
    new 
Float:vicOrigin[3]    
        
    
pev(ptrpev_originfl_vExplodeAt[id])
        
    new 
players[SH_MAXSLOTS], playerCount
    get_players
(playersplayerCount"ah")

    for ( new 
0playerCounti++ ) {
        
victim players[i]
    
        
pev(victimpev_originvicOrigin)
        
distanceBetween vector_distance(fl_vExplodeAt[id], vicOrigin)
        
        if ( 
distanceBetween <= dmgRadius ) {
            if ( 
FFOn || victim != id || idTeam != cs_get_user_team(victim) ) {

                
client_print(idprint_console"Poison Gas Damage")
                
                
sh_extra_damage(victimidmaxDamage"gas"_SH_DMG_NORMtrue_fl_vExplodeAt[id])
            }
        }
    }

__________________
The Art of War is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 02-16-2011 , 06:01   Re: Massive error output?
Reply With Quote #15

new Float:maxDamage = get_pcvar_num(pCvarMaxDamage)

Seriously...

Please learn the difference between floats and integers.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 02-16-2011 , 08:12   Re: Massive error output?
Reply With Quote #16

Yeah, sorry... I noticed I also used fl_vExplodeAt which should be completely unnecessary, and it is a float aswell.. Forgot that sh_extra_damage couldnt take floats, but had to go before I could edit my previous post. Thanks for all the help, will test it!

EDIT: So, now Ive tested that!..

I get runtime error 10's again:

Code:
L 02/16/2011 - 15:09:20: [AMXX] Run time error 10: native error (native "pev")
L 02/16/2011 - 15:09:20: [AMXX]    [0] sh_z_new_gas.sma::poison (line 479)
L 02/16/2011 - 15:09:20: [FAKEMETA] Invalid entity
L 02/16/2011 - 15:09:20: [AMXX] Displaying debug trace (plugin "sh_z_new_gas.amxx")
Line 479 is:
PHP Code:
pev(ptrpev_originfl_vExplodeAt[id]) 
(In public poison(parm[])

Strangely I only get it on that line, not with the exact same code on line 238, in fm_Touch.

I changed the victim != id to victim == id so I could check it by damaging myself, and well, buggy to say the least:

I am not damaged at all when Im standing in the the gas, and it seems Im only damaged once or several times (didnt see any pattern, mostly just a single 20 points damage) when Im shooting a new grenade after Ive already shot perhaps 10 rounds.

PHP Code:
// Exterminator!

/* CVARS - copy and paste to shconfig.cfg

//Exterminator 
exterminator_level 22
exterminator_mult 2.0        //Damage multiplyer for mp5
exterminator_grenades 5        //Grenades given
exterminator_m203rad 500        //Radius of people affected by a grenade
exterminator_m203maxdmg 200        //Max Grenades a mine can cause

*/

// Thanks to the original code of MP5+203 Mod by PaintLancer

#include <superheromod>

// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Exterminator"
new bool:gHasExterminator[SH_MAXSLOTS+1]
new 
gAmmo[SH_MAXSLOTS+1]

new 
Float:fl_vExplodeAt[SH_MAXSLOTS+1][3]

new const 
gPowerClass[] = "m203_nade"
new const gSoundLaunch[] = "shmod/glauncher.wav"
new const gSoundExplode[] = "shmod/a_exm2.wav"
new const gModelMP5[] = "models/shmod/exterminator_mp5.mdl"
new const gModelGrenade[] = "models/grenade.mdl"
new gSpriteTrail

new iGas

new gmsgStatusIcon
new pCvarGrenadespCvarRadiuspCvarMaxDamagepCvarTime
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Exterminator""1.0""The Art of War")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("exterminator_level""22")
    new 
pcvarMult register_cvar("exterminator_mp5mult""2.0")
    
pCvarGrenades register_cvar("exterminator_grenades""50")
    
pCvarRadius register_cvar("exterminator_m203rad""500")
    
pCvarMaxDamage register_cvar("exterminator_m203maxdmg""20")
    
pCvarTime register_cvar("exterminator_time""0.5")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Mp5 Gas Grenades""MP5 Gas Grenade Launcher. Use Your Right Mouse Button To Fire.")
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_MP5NAVY)
    
sh_set_hero_shield(gHeroIDtrue)

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO!
    
register_event("CurWeapon""weapon_change""be""1=1")
    
register_forward(FM_CmdStart"fm_CmdStart")
    
register_forward(FM_Touch"fm_Touch")

    
gmsgStatusIcon get_user_msgid("StatusIcon")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_sound(gSoundLaunch)
    
precache_sound(gSoundExplode)
    
precache_model(gModelMP5)
    
gSpriteTrail precache_model("sprites/smoke.spr")
    
iGas precache_model("sprites/shmod/gas.spr")
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return

    switch(
mode) {
        case 
SH_HERO_ADD: {
            
gHasExterminator[id] = true
            gAmmo
[id] = get_pcvar_num(pCvarGrenades)
            
exterminator_weapons(id)
            
switchmodel(id)
        }

        case 
SH_HERO_DROP: {
            
gHasExterminator[id] = false
            
if ( is_user_alive(id) ) {
                
sh_drop_weapon(idCSW_MP5NAVYtrue)
            }
        }
    }

    
sh_debug_message(id1"%s %s"gHeroNamemode "ADDED" "DROPPED")
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    
gPlayerInCooldown[id] = false

    
if ( gHasExterminator[id] ) {
        
exterminator_weapons(id)
        
gAmmo[id] = get_pcvar_num(pCvarGrenades)
    }
}
//----------------------------------------------------------------------------------------------
exterminator_weapons(id)
{
    if ( 
sh_is_active() && is_user_alive(id) && gHasExterminator[id] ) {
        
sh_give_weapon(idCSW_MP5NAVY)
    }
}
//----------------------------------------------------------------------------------------------
switchmodel(id)
{
    if ( !
sh_is_active() || !is_user_alive(id) || !gHasExterminator[id] ) return

    if ( 
get_user_weapon(id) == CSW_MP5NAVY ) {
        
set_pev(idpev_viewmodel2gModelMP5)
    }
}
//----------------------------------------------------------------------------------------------
public weapon_change(id)
{
    if ( !
sh_is_active() || !gHasExterminator[id] ) return

    
//weaponID = read_data(2)
    
if ( read_data(2) != CSW_MP5NAVY ) {
        
ammo_hud(id0)
        return
    }
    else {
        
ammo_hud(id1)
    }

    
switchmodel(id)
}
//----------------------------------------------------------------------------------------------
public fm_CmdStart(iduc_handleseed)
{
    if ( !
sh_is_active() || !gHasExterminator[id] || !is_user_alive(id) || sh_is_freezetime() ) return FMRES_IGNORED

    
if ( (get_uc(uc_handleUC_Buttons) & IN_ATTACK2) && !(pev(idpev_oldbuttons) & IN_ATTACK2) ) {
        if ( 
get_user_weapon(id) == CSW_MP5NAVY ) {
            
launch_nade(id)
        }
    }

    return 
FMRES_IGNORED
}
//----------------------------------------------------------------------------------------------
launch_nade(id)
{
    if ( 
gPlayerInCooldown[id] ) {
        
sh_sound_deny(id)
        return 
FMRES_IGNORED
    
}
    if ( 
gAmmo[id] == ) {
        
client_print(idprint_center"You are out of Gas grenades!")
        
sh_sound_deny(id)
        return 
FMRES_IGNORED
    
}

    
send_weapon_anim(id3)

    new 
Ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    if ( !
Ent ) return FMRES_IGNORED

    set_pev
(Entpev_classnamegPowerClass)
    
engfunc(EngFunc_SetModelEntgModelGrenade)

    
engfunc(EngFunc_SetSizeEnt, {-1.0, -1.0, -1.0}, {1.01.01.0})

    new 
Float:fl_Origin[3], Float:fl_Angles[3], Float:fl_vAngle[3]
    
// Get users postion and angles
    
pev(idpev_originfl_Origin)
    
pev(idpev_anglesfl_Angles)
    
pev(idpev_v_anglefl_vAngle)

    
// Change height of entity origin
    
fl_Origin[2] += 10.0

    
// Set entity postion and angles
    
engfunc(EngFunc_SetOriginEntfl_Origin)
    
set_pev(Entpev_anglesfl_Angles)
    
set_pev(Entpev_v_anglefl_vAngle)

    
// Set properties of the entity
    
set_pev(Entpev_effectsEF_MUZZLEFLASH)
    
set_pev(Entpev_solidSOLID_BBOX)
    
set_pev(Entpev_movetypeMOVETYPE_TOSS)
    
set_pev(Entpev_ownerid)

    new 
Float:fl_Velocity[3]
    
velocity_by_aim(id2000fl_Velocity)

    
set_pev(Entpev_velocityfl_Velocity)

    
emit_sound(idCHAN_WEAPONgSoundLaunchVOL_NORMATTN_NORM0PITCH_NORM)

    
// remove an ammo and refresh the hud
    
ammo_hud(id0)
    
gAmmo[id]--
    
ammo_hud(id1)

    new 
parm[1]
    
parm[0] = Ent
    set_task
(0.2"grenade_trail"idparm1)
    
sh_set_cooldown(id2.0)

    return 
FMRES_IGNORED
}
//----------------------------------------------------------------------------------------------
send_weapon_anim(idiAnim)
{
    
set_pev(idpev_weaponanimiAnim)

    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM_id)
    
write_byte(iAnim)
    
write_byte(pev(idpev_body))
    
message_end()
}
//----------------------------------------------------------------------------------------------
public fm_Touch(ptrptd)
{
    if ( !
sh_is_active() ) return FMRES_IGNORED
    
if ( !pev_valid(ptr) ) return FMRES_IGNORED
    
    
static classname[32]
    
classname[0] = '^0'
    
pev(ptrpev_classnameclassnamecharsmax(classname))

    if( 
equal(classnamegPowerClass) ) {
        new 
id pev(ptrpev_owner)

        
client_print(idprint_console"classnames, floats")
        
        
pev(ptrpev_originfl_vExplodeAt[id])

        new 
players[SH_MAXSLOTS], playerCountvictim
        get_players
(playersplayerCount"ah")

        for ( new 
0playerCounti++ ) {
            
victim players[i]
            
            
client_print(idprint_console"Poison Gas Task")
            
            new 
parm[3]
            
parm[0] = victim
            parm
[1] = ptr
            parm
[2] = id
                
            set_task
(get_pcvar_float(pCvarTime), "poison"999parm3"a"40)
        }


        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(100)//radius) (fire is made in a square around origin. -radius, -radius to radius, radius)
        
write_short(iGas)//modelindex)
        
write_byte(10)//count)
        
write_byte(24)//flags)
        
write_byte(200)//duration (in seconds) * 10) (will be randomized a bit)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY )
        
write_byteTE_FIREFIELD )
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 60)
        
write_short(150)
        
write_short(iGas)
        
write_byte(10)
        
write_byte(TEFIRE_FLAG_ALPHA TEFIRE_FLAG_SOMEFLOAT)
        
write_byte(200)
        
message_end()
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 60)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] + 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()
        
        
        
// Make small smoke near grenade on ground
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byte(TE_FIREFIELD)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][0] - 30)
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][1])
        
engfunc(EngFunc_WriteCoordfl_vExplodeAt[id][2] + 10)
        
write_short(10)
        
write_short(iGas)
        
write_byte(2)
        
write_byte(TEFIRE_FLAG_ALLFLOAT TEFIRE_FLAG_ALPHA)
        
write_byte(200)
        
message_end()

        
emit_sound(ptrCHAN_WEAPONgSoundExplodeVOL_NORMATTN_NORM0PITCH_NORM)

        
engfunc(EngFunc_RemoveEntityptr)
    }

    return 
FMRES_IGNORED
}
//----------------------------------------------------------------------------------------------
public poison(parm[])    
{
    
    new 
victim parm[0]
    new 
ptr parm[1]
    new 
id parm[2]
    
    
client_print(idprint_console"Poison forward, classnames, id")

    new 
maxDamage get_pcvar_num(pCvarMaxDamage)
    new 
Float:distanceBetween
    
new Float:dmgRadius get_pcvar_float(pCvarRadius)
    new 
FFOn sh_friendlyfire_on()
    new 
CsTeams:idTeam cs_get_user_team(id)
    new 
Float:vicOrigin[3]    
        
    
pev(ptrpev_originfl_vExplodeAt[id])
    
    
pev(victimpev_originvicOrigin)
    
distanceBetween vector_distance(fl_vExplodeAt[id], vicOrigin)
        
    if ( 
distanceBetween <= dmgRadius ) {
        if ( 
FFOn || victim == id || idTeam != cs_get_user_team(victim) ) {

        
client_print(idprint_console"Poison Gas Damage")
                
        
sh_extra_damage(victimidmaxDamage"gas"_SH_DMG_NORM_truefl_vExplodeAt[id])
        }
    }
}
//-----------------------------------------------------------------------------------------
ammo_hud(idshow)
{
    new 
SpriteString[32]
    
formatex(SpriteStringcharsmax(SpriteString), "number_%d"gAmmo[id])

    if (
show && gAmmo[id] > 0) {
        
message_begin(MSG_ONEgmsgStatusIcon_id)
        
write_byte(1)    // status (0 = hide, 1 = show, 2 = flash)
        
write_string(SpriteString)
        
write_byte(0)    // r, g, b
        
write_byte(160)    // r, g, b
        
write_byte(0)    // r, g, b
        
message_end()
    }
    else {
        
message_begin(MSG_ONEgmsgStatusIcon_id)
        
write_byte(0)    // status (0 = hide, 1 = show, 2 = flash)
        
write_string(SpriteString)
        
write_byte(0)    // r, g, b
        
write_byte(0)    // r, g, b
        
write_byte(0)    // r, g, b
        
message_end()
    }
}
//----------------------------------------------------------------------------------------------
public grenade_trail(parm[])
{
    new 
Ent parm[0]

    if (
Ent) {
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW)    //22
        
write_short(Ent)
        
write_short(gSpriteTrail)
        
write_byte(10)               // life
        
write_byte(5)                // width
        
write_byte(255)            // r, g, b
        
write_byte(255)            // r, g, b
        
write_byte(255)            // r, g, b
        
write_byte(100)            // brightness
        
message_end()
    }
}
//----------------------------------------------------------------------------------------------
public sh_client_death(id)
{
    if ( 
id || id sh_maxplayers() ) return

    if ( 
gHasExterminator[id] ) {
        
ammo_hud(id0)
    }
}
//----------------------------------------------------------------------------------------------
public sh_round_end()
{
    new 
players[SH_MAXSLOTS], numplayersvictim
    get_players
(playersnumplayers"ah")

    for ( new 
0numplayersi++ ) {
        
victim players[i]

        
remove_task(999)
    }

So I guess setting the task in fm_Touch is not a good idea... Would I be able to solve it by making just the one forward call in fm_Touch and setting the task in there, perhaps? Thanks.
__________________

Last edited by The Art of War; 02-16-2011 at 09:15.
The Art of War is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode