AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   CSNadePriming (https://forums.alliedmods.net/showthread.php?t=48607)

NemesisDelta 12-17-2006 05:24

Re: CSNadePriming
 
Code:

AMX Mod X version 1.76b Copyright (c) 2004-2006 AMX Mod X Development Team
...hmm i dont understand this... same problem for short time ago- but it was solved with the update to the new amx version

http://forums.alliedmods.net/showthr...481#post407481

so i have no idea whats wrong again


EDITED-------------------------------------------------------------------
------------------------------------------------------------------------
ok i found the problem, last time ive updated amx i forgot to copy all the files over my old one, so amx gots an old version of statsx; and the modules.ini was outdated to- now its fixed and your plugin works fine
--------------------------------------------------------------------------------------------------------------------------------------------------

Voi 02-13-2007 11:52

Re: CSNadePriming
 
works best with:
Code:

                        set_task(random_float(GRENADE_FUSE+1.0,GRENADE_FUSE),"explode_in_hand",id);
especially with shoot at nades(i use only fuse timing of this plugin)

HAARP 06-03-2007 10:16

Re: CSNadePriming
 
Blocking of "Fire in the hole" message and sound does not appear to work properly with "Descriptive Fire in the hole"

Any way to fix that?

Hatz 12-12-2007 01:58

Re: CSNadePriming
 
L 12/08/2007 - 21:32:19: [AMXX] Displaying debug trace (plugin "csnadeprime.amxx")
L 12/08/2007 - 21:32:19: [AMXX] Run time error 10: native error (native "get_msg_arg_string")
L 12/08/2007 - 21:32:19: [AMXX] [0] 12550.attach::msg_textmsg (line 157)

turnip11 03-12-2008 01:31

Re: CSNadePriming
 
Avalanche I Always look to see if you have come out with any new plugins/mods because you were the first person i got my first plugin from (FrostNades) But this one well it doesn't seem to download right at first i thought i was doing something wrong so i got my host to try and it didn't work they said there had been an error in the plugin and in my plugin list in game it says unknown strange its in my AMXXmodmenu does this sound like my amxx is out of date?

Voi 03-16-2008 15:49

Re: CSNadePriming
 
Quote:

L 03/16/2008 - 00:34:26: [AMXX] Run time error 10: native error (native "get_msg_arg_string")
L 03/16/2008 - 00:34:26: [AMXX] [0] csnadeprime.sma::msg_textmsg (line 156)
L 03/16/2008 - 00:34:26: Invalid message argument 3
L 03/16/2008 - 00:34:26: [AMXX] Displaying debug trace (plugin "csnadeprime.amxx")
could someone fix this ?

jay7981 05-30-2015 22:16

Re: CSNadePriming
 
I know this plugin is old but i just need to stop it from flooding my error logs ..
L 05/27/2015 - 04:17:44: [AMXX] Displaying debug trace (plugin "csnadeprime.amxx")
L 05/27/2015 - 04:17:44: [AMXX] Run time error 4: index out of bounds
L 05/27/2015 - 04:17:44: [AMXX] [0] 12550.attach::client_disconnect (line 63)
L 05/27/2015 - 04:17:44: [AMXX] [1] 12550.attach::event_deathmsg (line 57)


best i can tell here is the issue just not sure how to fix.

Line 57:
Code:

public event_deathmsg()
 {
        client_disconnect(read_data(2)); // clear
 }

Line 63:
Code:

public client_disconnect(id)
 {
        primed[id] = 0.0;
        forceExplode[id] = 0;
        remove_task(id);
 }


here is the .sma

Code:

#include <amxmodx>
 #include <csx>
 #include <fakemeta>

 #define GRENADE_FUSE        1.7
 #define ANIM_PULLPIN        1
 #define PRIME_SOUND        "weapons/boltup.wav"

 new cvEnabled, cvExplodeInHand, cvBlockStuff, Float:primed[33], forceExplode[33];

 // plugin initiation
 public plugin_init()
 {
        register_plugin("CSNadePriming","0.10","Avalanche");

        cvEnabled = register_cvar("csnp_enabled","1");
        cvExplodeInHand = register_cvar("csnp_explodeinhand","1");
        cvBlockStuff = register_cvar("csnp_blockstuff","1");

        register_clcmd("fullupdate","cmd_fullupdate");

        register_event("ResetHUD","event_resethud","b");
        register_event("DeathMsg","event_deathmsg","a");
        register_event("CurWeapon","event_curweapon","b","1=0");

        register_forward(FM_PlayerPreThink,"fw_playerprethink");
        register_forward(FM_CmdStart,"fw_cmdstart");

        register_message(get_user_msgid("SendAudio"),"msg_sendaudio");
        register_message(get_user_msgid("TextMsg"),"msg_textmsg");
        register_message(SVC_TEMPENTITY,"msg_tempentity");
 }

 // plugin precache
 public plugin_precache()
 {
        precache_sound(PRIME_SOUND);
 }

 // block fullupdate
 public cmd_fullupdate(id)
 {
        return PLUGIN_HANDLED;
 }

 // player respawns
 public event_resethud(id)
 {
        if(is_user_connected(id))
                client_disconnect(id); // clear
 }

 // player dies
 public event_deathmsg()
 {
        client_disconnect(read_data(2)); // clear
 }

 // player leaves
 public client_disconnect(id)
 {
        primed[id] = 0.0;
        forceExplode[id] = 0;
        remove_task(id);
 }

 // player switches FROM a weapon
 public event_curweapon(id)
 {
        if(!get_pcvar_num(cvEnabled))
                return;

        new oldWeapon = read_data(2);

        if(oldWeapon == CSW_FLASHBANG || oldWeapon == CSW_HEGRENADE)
                client_disconnect(id); // clear values
 }

 // player throws a grenade
 public grenade_throw(index,greindex,wId)
 {
        remove_task(index);

        if(!get_pcvar_num(cvEnabled))
                return;

        if(forceExplode[index])
        {
                // place it right on us
                new iOrigin[3], Float:fOrigin[3];
                get_user_origin(index,iOrigin,1);
                IVecFVec(iOrigin,fOrigin);
                engfunc(EngFunc_SetOrigin,greindex,fOrigin);

                // stop it from moving anywhere
                set_pev(greindex,pev_velocity,Float:{0.0,0.0,0.0});

                // get current time
                new Float:hltime;
                global_get(glb_time,hltime);

                // explode!
                set_pev(greindex,pev_dmgtime,hltime);

                forceExplode[index] = 0;
                primed[index] = 0.0;

                return;
        }
        else if(!primed[index]) return

        new Float:dmgtime, Float:newtime, Float:hltime;

        pev(greindex,pev_dmgtime,dmgtime);
        global_get(glb_time,hltime);

        // fuse has already ran up
        if(hltime - primed[index] > dmgtime - hltime) newtime = hltime

        // we have plenty of time left
        else newtime = dmgtime - (hltime - primed[index]);

        set_pev(greindex,pev_dmgtime,newtime);
        primed[index] = 0.0;
 }

 // fire in the hole sound
 public msg_sendaudio()
 {
        if(!get_pcvar_num(cvEnabled) || !get_pcvar_num(cvBlockStuff) || !forceExplode[get_msg_arg_int(1)])
                return PLUGIN_CONTINUE;

        static sound[18];
        get_msg_arg_string(2,sound,17);

        // stop grenade throwing radio alerts
        if(equal(sound,"%!MRAD_FIREINHOLE"))
                return PLUGIN_HANDLED;

        return PLUGIN_CONTINUE;
 }

 // fire in the hole message
 public msg_textmsg()
 {
        if(!get_pcvar_num(cvEnabled) || !get_pcvar_num(cvBlockStuff))
                return PLUGIN_CONTINUE;

        static message[21], name[32], testName[32], players[32];
        get_msg_arg_string(2,message,3);

        // some exception
        if(!str_to_num(message))
                return PLUGIN_CONTINUE;

        get_msg_arg_string(3,message,20);
        get_msg_arg_string(4,name,31);

        // CZ radio message
        if(equal(message,"#Game_radio_location",20))
                get_msg_arg_string(6,message,17);

        // regular radio message
        else if(equal(message,"#Game_radio",11))
                get_msg_arg_string(5,message,17);

        // "Fire in the hole!"
        if(!equal(message,"#Fire_in_the_hole"))
                return PLUGIN_CONTINUE;

        new i, id, num;
        get_players(players,num);

        // match name to player
        for(i=0;i<num;i++)
        {
                get_user_name(players[i],testName,31);
                if(equal(name,testName))
                {
                        id = players[i];
                        break;
                }
        }

        if(forceExplode[id])
                return PLUGIN_HANDLED;

        return PLUGIN_CONTINUE;
 }

 // exclamation mark from grenade throw
 public msg_tempentity()
 {
        // 124 = TE_PLAYERATTACHMENT
        if(!get_pcvar_num(cvEnabled) || !get_pcvar_num(cvBlockStuff)
        || get_msg_arg_int(1) != 124 || !forceExplode[get_msg_arg_int(2)])
                return PLUGIN_CONTINUE;

        // specifications of the grenade throw "!"
        if(get_msg_arg_float(3) == 35.0 && get_msg_arg_int(5) == 15)
                return PLUGIN_HANDLED;

        return PLUGIN_CONTINUE;
 }

 // player is about to think, really hard
 public fw_playerprethink(id)
 {
        if(!get_pcvar_num(cvEnabled) || primed[id])
                return FMRES_IGNORED;

        static dummy, weapon;
        weapon = get_user_weapon(id,dummy,dummy);

        if(weapon != CSW_FLASHBANG && weapon != CSW_HEGRENADE)
                return FMRES_IGNORED;

        if(pev(id,pev_weaponanim) != ANIM_PULLPIN)
                return FMRES_IGNORED;

        // just pressed secondary fire
        if((pev(id,pev_button) & IN_ATTACK2) && !(pev(id,pev_oldbuttons) & IN_ATTACK2))
        {
                global_get(glb_time,primed[id]);
                emit_sound(id,CHAN_WEAPON,PRIME_SOUND,0.5,ATTN_NORM,0,PITCH_HIGH);

                if(get_pcvar_num(cvExplodeInHand))
                        set_task(random_float(GRENADE_FUSE-1.0,GRENADE_FUSE),"explode_in_hand",id);
        }

        return FMRES_IGNORED;
 }

 // sending out commands
 public fw_cmdstart(id,uc_handle,seed)
 {
        if(!get_pcvar_num(cvEnabled) || !forceExplode[id])
                return FMRES_IGNORED;

        // force him to throw grenade, let go of trigger
        set_uc(uc_handle,UC_Buttons,get_uc(uc_handle,UC_Buttons) & ~IN_ATTACK);
        set_uc(uc_handle,UC_Buttons,get_uc(uc_handle,UC_Buttons) & ~IN_ATTACK2);

        return FMRES_HANDLED;
 }

 // BOOM in your face!
 public explode_in_hand(id)
 {
        if(primed[id]) forceExplode[id] = 1;
 }



All times are GMT -4. The time now is 08:14.

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