AlliedModders

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

VEN 01-09-2006 16:56

Sticky Nades
 
1 Attachment(s)
        • Sticky Nades
Description
  • Plugin provide sticky effect for throwed (with +attack) grenades.
Features
  • - ability to make nades stick to any object (default: stick to players only)
    - ability to exclude certain nade type from being sticky
Modules
  • engine
    fakemeta
    (first feature only)
Configuration
  • ANY_OBJECT - uncomment to enable first feature
    Chahge other options only if you want to use second feature.
    CUSTOM_NADES - uncomment to enable second feature
    NADE_TYPES - number of total types of sticky nades (default: 3)
    NADE_MODEL - remove certain model to exclude appropriate nade
CVARs
  • amx_sticky_nades (0: OFF, 1: ON, default: 1) - disables/enables the plugin
Thanks
  • lickityspliff - for initial idea

kILL-jOY 01-09-2006 16:59

great idea

im downloading it now 8)

bmann_420 01-09-2006 17:10

Very Cool. :D I like it.

v3x 01-09-2006 19:07

Hmm, I like how you caught the sound and went from there. Good job :)

Dirty DuMont 01-09-2006 19:33

Heh, looks like you should be working with knexter for the Halo Mod. Nice plugin. :D

rockett702 08-11-2007 05:03

Re: Sticky Nades
 
Hello, I am trying to use this mod on my gun game server.

I have put the .amxx and the .sma file in teh corect directories and have edited the .sma file to allow custom nades since I have custom skins on my server. The code is below:

Code:

/* AMX Mod X
*  Sticky Nades
*
* (c) Copyright 2005-2006 by VEN
*
* This file is provided as is (no warranties)
*
*    DESCRIPTION
*      Plugin provide sticky effect for throwed (with +attack) grenades.
*
*    FEATURES
*      - ability to make nades stick to any object (default: stick to players only)
*      - ability to exclude certain nade type from being sticky
*
*    MODULES
*      engine
*      fakemeta (first feature only)
*
*    CONFIGURATION
*      ANY_OBJECT - uncomment to enable first feature
*      Chahge other options only if you want to use second feature.
*      CUSTOM_NADES - uncomment to enable second feature
*      NADE_TYPES - number of total types of sticky nades (default: 3)
*      NADE_MODEL - remove certain model to exclude appropriate nade
*
*    CVARS
*      amx_sticky_nades (0: OFF, 1: ON, default: 1) - disables/enables the plugin
*
*    THANKS
*      lickityspliff - for initial idea
*/
/* *************************************************** Init **************************************************** */
#include <amxmodx>
#include <engine>
#define CVAR "amx_sticky_nades"
#define ANY_OBJECT
#define CUSTOM_NADES
#if defined ANY_OBJECT
 #include <fakemeta>
 // do not change
 #define BOUNCE_SOUNDS 4
 new const BOUNCE_SOUND[BOUNCE_SOUNDS][] = {"weapons/grenade_hit1.wav", "weapons/grenade_hit2.wav", "weapons/grenade_hit3.wav", "weapons/he_bounce-1.wav"}
#endif
#if defined CUSTOM_NADES
 #define NADE_TYPES 3
 new const NADE_MODEL[NADE_TYPES][] = {"models/w_hegrenade.mdl", "models/w_flashbang.mdl", "models/w_smokegrenade.mdl"}
#endif
public plugin_init() {
 register_plugin("Sticky Nades", "0.1", "VEN")
 register_touch("grenade", "player", "touch_nade")
#if defined ANY_OBJECT
 register_forward(FM_EmitSound, "forward_emit_sound")
#endif
 register_cvar(CVAR, "1")
}
/* *************************************************** Base **************************************************** */
public touch_nade(nade, id) {
 if (!is_nade_bounce(nade) || !get_cvar_num(CVAR) || is_nade_excluded(nade))
  return
 entity_set_edict(nade, EV_ENT_aiment, id)
 entity_set_int(nade, EV_INT_movetype, MOVETYPE_FOLLOW)
 entity_set_int(nade, EV_INT_sequence, 0)
}
#if defined ANY_OBJECT
public forward_emit_sound(nade, channel, sound[]) {
 if (is_nade_bounce(nade)) {
  for (new i = 0; i < BOUNCE_SOUNDS; ++i) {
  if (equal(sound, BOUNCE_SOUND[i]) && !is_nade_excluded(nade)) {
    entity_set_int(nade, EV_INT_movetype, MOVETYPE_NONE)
    entity_set_int(nade, EV_INT_sequence, 0)
    break
  }
  }
 }
}
#endif
/* ************************************************** Stocks *************************************************** */
stock bool:is_nade_bounce(nade) {
 return entity_get_int(nade, EV_INT_movetype) == MOVETYPE_BOUNCE
}
stock bool:is_nade_excluded(nade) {
#if defined CUSTOM_NADES
 new i, model[32]
 for (i = 0; i < NADE_TYPES; ++i) {
  entity_get_string(nade, EV_SZ_model, model, 31)
  if (equal(model, NADE_MODEL[i]))
  break
 }
 if (i == NADE_TYPES)
  return true
 return false
#else
 return nade != nade // i know what you are thinking about, i'm not insane, i use this to avoid the compile warning
#endif
}
/* **************************************************** EOF **************************************************** */


I am not sure what file I am supposed to put amx_sticky_nades

I have also activated the plugin by putting the .amxx under 3rd party plugins in the plugins.ini file.

P.S. I am a noob when it comes to this stuff and am amazed that I have gotten done what I have. Any help would be much appreciated. Thank you

Halolo 08-11-2007 05:27

Re: Sticky Nades
 
amx_sticky_nades write that into your cvars with a "1" at the end. :arrow: amx_sticky_nades 1 <--
Then the plugin is activated and if you've written it into your plugins.ini .. it should work ;)

rockett702 08-11-2007 05:43

Re: Sticky Nades
 
cvars.ini correct?

bmann_420 08-11-2007 12:34

Re: Sticky Nades
 
server.cfg or amxx.cfg
(hit "Get Plugin" and put that in your plugins folder)

wadup_84 09-30-2007 18:51

Re: Sticky Nades
 
how do i make it stick to other things like the car in cs_assault or walls?


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

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