Raised This Month: $105 Target: $400
 26% 

SuperNade


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   VEN (29)
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-01-2007 , 15:56   SuperNade
Reply With Quote #1

SuperNade v3.5

Description:
This plugin allows you to buy a SuperNade with more damage, a larger blast area, and if it is thrown near a planted bomb. The Bomb will explode!

Client Comands:
/nade - buys a supernade
.nade - buys a supernade

both same comand, take your pick.

Cvars:
mp_supernade - supernade on or off? 1=on, 0=off [default = 1]
sn_cost - cost to buy a supernade [default=1000]
sn_damage - EXTRA damage (meaning in addition to regular damage) that a supernade does [default = 30]
sn_radius - Damage radius of SuperNade, normal nade radius is 300.0, placing any lower than that will defeat the purpose, and probably cause glitches...[default = 400.0, MUST BE DECIMAL]
sn_lose - determines if you lose an unused supernade after round is over [default=1]
sn_nades_per_round - determines how many supernades you can buy per round, set to "0" for unlimited, if you have the money [default=0]

Required Modules:
cstrike, and fakemeta

Credits:
Thanks to everyone how answered all my questions on the nade thread I made, but big thanks to Cheap Suit who's idea it was to catch the nade explosion using FM_Think, and regalis, because he is in love with fakemeta
Attached Files
File Type: sma Get Plugin or Get Source (SuperNade.sma - 6208 views - 7.7 KB)
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 06-12-2007 at 13:55.
Rolnaaba is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-01-2007 , 16:03   Re: SuperNade
Reply With Quote #2

Heh...atleast ...*C0ol* Gj +K
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-02-2007 , 00:56   Re: SuperNade
Reply With Quote #3

updated, fixed misc bugs
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
ExKiLL
Senior Member
Join Date: Nov 2005
Location: Germany
Old 06-02-2007 , 07:32   Re: SuperNade
Reply With Quote #4

could you fix the lost after round end and add sn_radius for the blast area?

gj mate
__________________
193.192.59.43:27015 ----- italy ( 20 )
85.25.150.62:27015 ------ sHclachthaus ( 14 )
85.25.150.62:27055 ------ DeathMatch ( 20 )
85.25.150.62:27035 ------ Kreedz Hangout ( 18 )
85.214.100.160:27015 ---- 24/7 full house | **GG + DM** ( 32 )
93.190.64.150:27015 ----- Superhero (12)
ExKiLL is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-02-2007 , 14:48   Re: SuperNade
Reply With Quote #5

Quote:
Originally Posted by ExKiLL View Post
could you fix the lost after round end and add sn_radius for the blast area?

gj mate
I can add sn_radius, but I want you too lose it after round end, I did that on purpose.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-02-2007 , 16:20   Re: SuperNade
Reply With Quote #6

UPDATED, added sn_radius cvar and fixed a bug with not setting HasSuperNade to false after you throw a supernade.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-03-2007 , 12:58   Re: SuperNade
Reply With Quote #7

Why id-1 ?

And instead of
Code:
 new wpnids[32], num;
 get_user_weapons(id, wpnids, num);
 
 new bool:has;
 
 for(new i = 0; i < num; i++) {
  if(wpnids[i] == CSW_HEGRENADE) {
   has = true;
  }
 }
You could use for example user_has_weapon() native.
VEN is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 06-03-2007 , 13:49   Re: SuperNade
Reply With Quote #8

because I was getting a pev error and didnt realize it, I am not going to get into that again, but here is what is up with my newest update:
pev_owner was not returning the correct owner in EmitSound, so i tried to use the grenade_throw forward from csx, but the pev_origin was not collecting correctly in that function so I did this: I used both. I gether the owner upon nade throw and pass it along a task to a function that is called just after the nade explosion actually happens. At the same time I have EmitSound gather the origin of the grenade explosion and store it in a global var. Thereby allowing the correct owner and origin to be used in the funciton claled after nade expolosion and to begin search for c4 entity and do extra damage stuff. I hate using this method because if someone else throws a grenade, anywhere from the time of actual explosion to end the nade_explosion function called just after, if someone has a grenade explode anywhere in that middle time, the grenade_explode function will use that persons grenade as a supernade, even if the person who threw it does not have a supernade. If you have abetter idea VEN please let me know, because I need a new method. The EmitSound usage to catch explosion doesnt allow me to gather owner, because the nade is removed already, and the grenade throw I cant grab the origin, because the nade is moving. But this version should work most of the time.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
ExKiLL
Senior Member
Join Date: Nov 2005
Location: Germany
Old 06-03-2007 , 14:19   Re: SuperNade
Reply With Quote #9

Quote:
Originally Posted by Rolnaaba View Post
you lose it after round end, I did that on purpose.

could you add an cvar here too?

sn_lose 1/0

btw nice plugin
__________________
193.192.59.43:27015 ----- italy ( 20 )
85.25.150.62:27015 ------ sHclachthaus ( 14 )
85.25.150.62:27055 ------ DeathMatch ( 20 )
85.25.150.62:27035 ------ Kreedz Hangout ( 18 )
85.214.100.160:27015 ---- 24/7 full house | **GG + DM** ( 32 )
93.190.64.150:27015 ----- Superhero (12)
ExKiLL is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 06-03-2007 , 14:46   Re: SuperNade
Reply With Quote #10

Here you are. A better way to check when the grenade explode.

PHP Code:
public plugin_init()
{
 
register_forward(FM_Think"fwd_think")
}
public 
fwd_think(ent)
{
 if(!
pev_valid(ent))
  return 
FMRES_IGNORED
 
 
static classname[32]
 
pev(entpev_classnameclassname31)
 
 if(
equal(classname"grenade"))
 {
  static 
model[32]
  
pev(entpev_modelmodel31)
 
  if(!
equal(model"models/w_hegrenade.mdl"))
   return 
FMRES_IGNORED
 
  
new Float:gametime get_gametime()
 
  new 
Float:dmgtime
  pev
(entpev_dmgtimedmgtime)
 
  if((
dmgtime gametime) < -0.1)
  {
   new 
owner pev(entpev_owner)
 
   static 
Float:origin[3]
   
pev(entpev_originorigin)
 
   
server_print("Owner %d"owner)
   
server_print("Origin: %f %f %f"origin[0], origin[1], origin[2])
 
   
/* Output
   Owner 1
   Origin: 131.951049 2945.589599 252.854705
   */
  
}
 }
 return 
FMRES_IGNORED

__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Old 06-03-2007, 17:24
organizedKaoS
This message has been deleted by organizedKaoS.
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 04:14.


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