Raised This Month: $94 Target: $400
 23% 

Sticky Nades


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   v3x (159)
VEN
Veteran Member
Join Date: Jan 2005
Old 01-09-2006 , 17:56   Sticky Nades
Reply With Quote #1

        • 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
Attached Files
File Type: sma Get Plugin or Get Source (stickynades.sma - 10336 views - 3.3 KB)
VEN is offline
kILL-jOY
Member
Join Date: Jul 2005
Old 01-09-2006 , 17:59  
Reply With Quote #2

great idea

im downloading it now
__________________
**|$uperHero|** Free level 8 / 75+ Heroes / BuyXP at 68.191.146.3:27015 - CS 1.6


kILL-jOY is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 01-09-2006 , 18:10  
Reply With Quote #3

Very Cool. I like it.
__________________
bmann_420 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 01-09-2006 , 20:07  
Reply With Quote #4

Hmm, I like how you caught the sound and went from there. Good job
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Dirty DuMont
Member
Join Date: Jan 2006
Old 01-09-2006 , 20:33  
Reply With Quote #5

Heh, looks like you should be working with knexter for the Halo Mod. Nice plugin.
Dirty DuMont is offline
Send a message via AIM to Dirty DuMont
rockett702
Junior Member
Join Date: Aug 2007
Old 08-11-2007 , 06:03   Re: Sticky Nades
Reply With Quote #6

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
rockett702 is offline
Halolo
Senior Member
Join Date: Jul 2006
Location: Germany/Hessen
Old 08-11-2007 , 06:27   Re: Sticky Nades
Reply With Quote #7

amx_sticky_nades write that into your cvars with a "1" at the end. amx_sticky_nades 1 <--
Then the plugin is activated and if you've written it into your plugins.ini .. it should work ;)
__________________
Halolo is offline
rockett702
Junior Member
Join Date: Aug 2007
Old 08-11-2007 , 06:43   Re: Sticky Nades
Reply With Quote #8

cvars.ini correct?
rockett702 is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 08-11-2007 , 13:34   Re: Sticky Nades
Reply With Quote #9

server.cfg or amxx.cfg
(hit "Get Plugin" and put that in your plugins folder)
__________________
bmann_420 is offline
wadup_84
Junior Member
Join Date: Aug 2007
Old 09-30-2007 , 19:51   Re: Sticky Nades
Reply With Quote #10

how do i make it stick to other things like the car in cs_assault or walls?
wadup_84 is offline
Reply


Thread Tools
Display Modes

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 20:12.


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