Raised This Month: $12 Target: $400
 3% 

Award Grenades: Reloaded v1.5


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   v3x (159)
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-14-2008 , 16:13   Award Grenades: Reloaded v1.5
Reply With Quote #1

Award Grenades: Reloaded

.: Description :.
When you kill a person you'll be awarded with Grenades.
You can use 3 conditions:
1. Team
2. Head Shot
3. Weapon

.: Required Modules :.
Fun
CSX
CStrike

.: CVARs :.
Code:
award_nades 1        //Enables the plugin
award_he 1        //How many HE Grenades a player should be awarded when killing another player?
award_fb 1        //How many Flash Bangs a player should be awarded when killing another player?
award_sg 1        //How many Smoke Grenades a player should be awarded when killing another player?
he_max 3        //What's the maximum number of HEs a player can be awarded with?
fb_max 5        //What's the maximum number of FBs a player can be awarded with?
sg_max 4        //What's the maximum number of SGs a player can be awarded with?
award_team Any        //Which team should be awarded? (Any, CT, T)
award_headshot 0    //Is a Head Shot needed ot get awarded?
award_weapon any    //What weapon is needed to get awarded? (knife, usp, glock18, etc.)
.: CMDs :.
Code:
say /awardcmds                                //Shows Award Grenades: Reloaded Commands
say /awardmenu                                //Shows a menu to know the awards and conditions
award_nades_toggle <0|1>                        //ADMIN_LEVEL_D, Enables or disables the plugin
award_nades_awards <he><fb><sg>                        //ADMIN_LEVEL_D, Changes the the awarded Grenades
give_nade <name> <nade>    <amount>                    //ADMIN_LEVEL_D, Gives a Grenade to a player
//Leave <nade> empty to give all Grenades, 'he' to give HEs, 'fb' to give Flash Bangs, 'sg' to give smoke grenades
award_team_toggle <Any|CT|T>                        //ADMIN_LEVEL_D, Changes which team should be awarded? *case sensetive*
award_hs_toggle <0|1>                            //ADMIN_LEVEL_D, Changes if a head shot is needed to get awarded
award_wpn_toggle <any|weapon name>                    //ADMIN_LEVEL_D, Changes if a weapon is needed to get awarded (knife, usp, glock18, etc.)
award_valid_weapons                            //ADMIN_LEVEL_D, Shows valid weapons
award_valid_weapons2                            //ADMIN_LEVEL_D, Shows the rest of the valid weapons
.: Updates :.
v1.1
- Fixed some scripting errors

v1.2
- Added award_team cvar and award_team_toggle command

v1.3
-Changed name to "Award Grenades: Reloaded"
-Added award_headshot and award_weapon CVARs
-Added award_nades_awards, award_hs_toggle, award_wpn_toggle, award_valid_weapons and award_valid_weapons2 ADMIN_LEVEL_D commands
-Added /awardcmds and /awardmenu client commands

v1.4
-Some bug fixes

v1.5
-Removed "award_fb_amount" CVAR
-Added "he_max", "fb_max" and "sg_max" CVARs
-Now the plugin uses v3x's Grenade Sack method to give nades

Requested
Attached Files
File Type: sma Get Plugin or Get Source (award_nades.sma - 4615 views - 20.0 KB)
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System

Last edited by Sam Tsuki; 09-07-2008 at 12:02.
Sam Tsuki is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-14-2008 , 16:22   Re: Award Grenades
Reply With Quote #2

You can remove #include <engine> as engine is not needed.
client_death is a csx forward so you need to include it.

You must use pcvars and learn how to use it.
PHP Code:
    //Check if Award Grenades is enabled
    
if(award_nades == 0) return PLUGIN_HANDLED 
Correct way :
PHP Code:
    //Check if Award Grenades is enabled
    
if(get_pcvarnum(award_nades) == 0) return PLUGIN_HANDLED 
There's a lot of other errors.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-14-2008 at 16:27.
ConnorMcLeod is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-14-2008 , 16:24   Re: Award Grenades
Reply With Quote #3

Quote:
Originally Posted by connorr View Post
You can remove #include <engine> as engine is not needed.
client_death is a csx forward so you need to include it.

You must use pcvars and learn how to use it.
PHP Code:
    //Check if Award Grenades is enabled
    
if(award_nades == 0) return PLUGIN_HANDLED 
Correct way :
PHP Code:
    //Check if Award Grenades is enabled
    
if(get_pcvarnum(award_nades) == 0) return PLUGIN_HANDLED 
There's a lot of other errors.
Done with everything
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System

Last edited by Sam Tsuki; 08-14-2008 at 16:31.
Sam Tsuki is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-14-2008 , 16:37   Re: Award Grenades
Reply With Quote #4

Then this is false :

PHP Code:
    award_nades str_to_num(arg
And you still don't use pcvars for :
PHP Code:
    register_cvar("award_he""1")
    
register_cvar("award_fb""1")
    
register_cvar("award_fb_amount""2")
    
register_cvar("award_sg""1"
Also you should use DeathMsg event instead of csx forward.

Other big error :
PHP Code:
    if(get_cvar_num("award_fb") == 1) {
        
give_item(attacker"weapon_flashbang")
        if(
get_cvar_num("award_fb_amount") == 2)
            
give_item(attacker"weapon_flashbang")
    } 
Value 2 will never be detected.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-14-2008 , 16:44   Re: Award Grenades
Reply With Quote #5

Quote:
Originally Posted by connorr View Post
Then this is false :

PHP Code:
    award_nades str_to_num(arg
And you still don't use pcvars for :
PHP Code:
    register_cvar("award_he""1")
    
register_cvar("award_fb""1")
    
register_cvar("award_fb_amount""2")
    
register_cvar("award_sg""1"
Also you should use DeathMsg event instead of csx forward.

Other big error :
PHP Code:
    if(get_cvar_num("award_fb") == 1) {
        
give_item(attacker"weapon_flashbang")
        if(
get_cvar_num("award_fb_amount") == 2)
            
give_item(attacker"weapon_flashbang")
    } 
Value 2 will never be detected.
That's wierd
I test it and it's working well
When I used DeathMsg I got a no free edict error
I tried putting award_fb_amount to 1 and 2 and both worked probably
And about the:
Code:
award_nades = str_to_num(arg)
Even if I used:
Code:
award_nades = arg
It will still do the same
Correct me if anything is wrong
I'm still new you know
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System

Last edited by Sam Tsuki; 08-14-2008 at 16:46.
Sam Tsuki is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-14-2008 , 17:01   Re: Award Grenades
Reply With Quote #6

Ok...
Converted all cvars to pcvars and they're working well
Now I need to find a solution for the no free edicts error when using DeathMsg
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-14-2008 , 17:10   Re: Award Grenades
Reply With Quote #7

Quote:
Originally Posted by Sam Tsuki View Post
Even if I used:
Code:
award_nades = arg
Seems that you should learn more before posting plugins.
Just keep on.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-14-2008 , 18:12   Re: Award Grenades
Reply With Quote #8

Quote:
Originally Posted by connorr View Post
Seems that you should learn more before posting plugins.
Just keep on.
Yeah I didn't notice
I need to convert award_nades to an array to use that one
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-14-2008 , 19:23   Re: Award Grenades
Reply With Quote #9

connorr you're such a cocky

Sam Tsuki, this:

PHP Code:
if(equal(arg1"")) {
  
console_print(id"[AG] Usage: give_nade <name> <nade he,fb,sg> <amount 1,2>")
  return 
PLUGIN_HANDLED
 

does the same as:
PHP Code:
register_concmd("give_nade""give_nade"ADMIN_LEVEL_D"<name> <nade he,fb,sg> <amount 1,2>"
it will print the usage if nothing was put while used the console command.

same for the other concmd.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 08-14-2008 at 19:26.
Dores is offline
Sam Tsuki
Senior Member
Join Date: Apr 2008
Location: KoKoRo!
Old 08-14-2008 , 19:34   Re: Award Grenades
Reply With Quote #10

Quote:
Originally Posted by dor123 View Post
connorr you're such a cocky

Sam Tsuki, this:

PHP Code:
if(equal(arg1"")) {
  
console_print(id"[AG] Usage: give_nade <name> <nade he,fb,sg> <amount 1,2>")
  return 
PLUGIN_HANDLED
 

does the same as:
PHP Code:
register_concmd("give_nade""give_nade"ADMIN_LEVEL_D"<name> <nade he,fb,sg> <amount 1,2>"
it will print the usage if nothing was put while used the console command.

same for the other concmd.
Ok...
Removed
__________________
My Approved Plugins:
Sam Tsuki

HvM XP Mod's addons:
Co-op Maps
Money System
Sam Tsuki 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 07:08.


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