Raised This Month: $32 Target: $400
 8% 

When someone kills with a headshot to give him a HE grenade.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 07-18-2012 , 10:54   When someone kills with a headshot to give him a HE grenade.
Reply With Quote #1

Can someone write me the following plugin when someone kills someone with headshot to give him a HE grenade.
.:cs.stambeto:. is offline
isotonic
AlliedModders Donor
Join Date: Jun 2011
Location: Moscow, Russia
Old 07-21-2012 , 10:19   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #2

Do you still need it?
__________________
isotonic is offline
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 07-21-2012 , 11:53   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #3

Quote:
Originally Posted by isotonic View Post
Do you still need it?
YES
.:cs.stambeto:. is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-21-2012 , 12:37   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #4

You can change the number if the grenades given by changing the cvar hs_grenbonus_num (by default it is set to 1 grenade)
Code:
#include <amxmodx> #include <fun> new const PLUGIN[] = "HeadShot Grenade bonus" new const AUTHOR[] = "Khalid" new const VERSION[] = "1.0" new g_pGrenNum public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("DeathMsg", "eDeath", "a", "1!=2")     g_pGrenNum = register_cvar("hs_grenbonus_num", "1") } public eDeath() {     new IsHeadShot, iKillerId         IsHeadShot = read_data(3)     if( IsHeadShot == 1 )     {         iKillerId = read_data(1)                 new gren         gren = get_pcvar_num(g_pGrenNum)                 switch(gren)         {             case 0:                 return PLUGIN_HANDLED                         case 1:                 give_item(iKillerId, "weapon_hegren")                             default:             {                 for(new i; i <= gren; i++)                 {                     give_item(iKillerId, "weapon_gren")                 }             }         }     }     return PLUGIN_HANDLED    }
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 07-21-2012 , 13:24   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #5

L 07/21/2012 - 20:23:04: [FUN] Item "weapon_hegren" failed to create
L 07/21/2012 - 20:23:04: [AMXX] Displaying debug trace (plugin "granade.amxx")
L 07/21/2012 - 20:23:04: [AMXX] Run time error 10: native error (native "give_item")
L 07/21/2012 - 20:23:04: [AMXX] [0] granade.sma::eDeath (line 32)
.:cs.stambeto:. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-21-2012 , 14:07   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <fun>

#define VERSION "0.0.1"
#define PLUGIN "He Bonus on HeadShots"

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_event("DeathMsg""Event_DeathMsg_HeadShot""a""1>0""3=1")
    
g_iMaxPlayers get_maxplayers()
}

public 
Event_DeathMsg_HeadShot()
{
    new 
id read_data(1)
    if( 
id <= g_iMaxPlayers && user_has_weapon(idCSW_HEGRENADE) ) // user_has_weapon should return 0 on dead players
    
{
        
give_item(id"weapon_hegrenade")
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 07-21-2012 , 14:17   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
#include <amxmodx>
#include <fun>

#define VERSION "0.0.1"
#define PLUGIN "He Bonus on HeadShots"

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_event("DeathMsg""Event_DeathMsg_HeadShot""a""1>0""3=1")
    
g_iMaxPlayers get_maxplayers()
}

public 
Event_DeathMsg_HeadShot()
{
    new 
id read_data(1)
    if( 
id <= g_iMaxPlayers && user_has_weapon(idCSW_HEGRENADE) ) // user_has_weapon should return 0 on dead players
    
{
        
give_item(id"weapon_hegrenade")
    }

I do not know but why not give me HE grenade to ask you with all weapons is done by killing someone with a head to give a grenade.
.:cs.stambeto:. is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 07-21-2012 , 15:15   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #8

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx> 
#include <fun>

#define PLUGIN "HS give HE"
#define VERSION "1.0"
#define AUTHOR "Freestyle"

public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
register_event("DeathMsg""deadmsg""a");
}

public 
deadmsg()
{
    new 
kid read_data(1);
    
    if(
read_data(3))
    {
        
give_item(kid"weapon_hegrenade");
    }

I think this would work.
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 07-21-2012 , 16:19   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #9

Quote:
Originally Posted by quilhos View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx> 
#include <fun>

#define PLUGIN "HS give HE"
#define VERSION "1.0"
#define AUTHOR "Freestyle"

public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
register_event("DeathMsg""deadmsg""a");
}

public 
deadmsg()
{
    new 
kid read_data(1);
    
    if(
read_data(3))
    {
        
give_item(kid"weapon_hegrenade");
    }

I think this would work.
L 07/21/2012 - 23:180: [AMXX] Displaying debug trace (plugin "granade.amxx")
L 07/21/2012 - 23:180: [AMXX] Run time error 3: stack error


Only this plugin works on my csdm can I get it lighten code
Attached Files
File Type: sma Get Plugin or Get Source (award_nades.sma - 756 views - 13.7 KB)

Last edited by .:cs.stambeto:.; 07-21-2012 at 16:26.
.:cs.stambeto:. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-21-2012 , 16:53   Re: When someone kills with a headshot to give him a HE grenade.
Reply With Quote #10

Remove :
&& user_has_weapon(id, CSW_HEGRENADE)

if you want to allow more than 1 grenade.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 22:23.


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