Raised This Month: $66 Target: $400
 16% 

Subplugin Submission [CS] First Blood Reward v5.3 (ZP compatible/ 13 Rewards)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-16-2014 , 16:02   [CS] First Blood Reward v5.3 (ZP compatible/ 13 Rewards)
Reply With Quote #1

[CS] First Blood Reward v5.3
(ZP compatible/ 13 Rewards)

Status:
UP-TO-DATE
(6/12/2014)

This is my second plugin for ZP.
Quote:
This plugin is compatible with ZPA 1.6.1, ZP4.3, ZP5.0 and ZPS.
Configuration:

If you want to use this plugin for ZP mode, just open the .sma file, then uncomment this line:
PHP Code:
//Uncomment 'IM_USING_ZP' if you want to use this plugin in ZP mode.
//#define IM_USING_ZP 
If you want to use this plugin in ZPA, just edit this line:
PHP Code:
// if you are using this plugin for ZPA, 
// just change #include <zombieplague>  into #include <zombie_plague_advance> 
#if defined IM_USING_ZP
#include <zombieplague> 
#endif 
What new!
Quote:
1. Invisibility reward.
2. Noclip reward.
3. Grenades reward.
4. Weapon reward.
5. Health reward.
6. Deadly shot reward.
7. God mode reward.
8. Glow reward.
9. Aura reward.
10. Armor reward.
11. Money reward.
12. Multi-jump reward.
13. Speed boost reward.
Description:
Quote:
This plugin will give reward or bonus to the first person who kill the enemy.
What can you edit?

Now, just edit the firstblood.cfg file, so that you don't need to compile the .sma file every time you want to change the value. ;)
PHP Code:
    cvar_e1 register_cvar("fb_enable_health_reward""1")  // Enable health reward 
    
cvar_health register_cvar("fb_health_reward""50")  // The values of health reward 
    
cvar_e2 register_cvar("fb_enable_armor_reward""1")  // Enable armor reward 
    
cvar_armor register_cvar("fb_armor_reward""25"// The values of armor reward 
    
cvar_e3 register_cvar("fb_enable_money_reward""1")  // Enable money reward 
    
cvar_money register_cvar("fb_money_reward""500"// The values of money reward 
    
cvar_e4 register_cvar("fb_enable_invisible_reward""0")  // Enable invisible reward 
    
cvar_invisible register_cvar("fb_invisible_amount""5"// The visibility amount
    
cvar_invisible_time register_cvar("fb_invisible_time""45.0"// The time given for invisible
    
cvar_e5 register_cvar("fb_enable_noclip_reward""0")  // Enable noclip reward 
    
cvar_noclip_time register_cvar("fb_noclip_time""45.0"// The time given for noclip
    
cvar_e6 register_cvar("fb_enable_grenade_reward""0")  // Enable grenade reward 
    
cvar_grenade register_cvar("fb_grenade_amount""1"// Amount of flasbang reward
    
cvar_e7 register_cvar("fb_enable_weapon_reward""0")  // Enable weapon reward 
    
cvar_weapon register_cvar("fb_weapon_type""weapon_aug")  // Type of weapon reward
    
cvar_e8 register_cvar("fb_enable_headshot_reward""0")  // Enable deadly shot reward 
    
cvar_headshot_time register_cvar("fb_headshot_time""45.0"// The time given for deadly shot
    
cvar_e9 register_cvar("fb_enable_godmode_reward""0")  // Enable god mode reward
    
cvar_godmode_time register_cvar("fb_godmode_time""45.0")  // The time given for god mode
    
cvar_e10 register_cvar("fb_enable_glow_reward""0")  // Enable glow reward
    
cvar_glow_time register_cvar("fb_glow_time""15.0"// The time given for glow
    
cvar_e11 register_cvar("fb_enable_aura_reward""0")  // Enable aura reward
    
cvar_aura_time register_cvar("fb_aura_time""15.0"// The time given for aura
    
cvar_e12 register_cvar("fb_enable_speed_reward""0")  // Enable speed boost reward
    
cvar_speed register_cvar("fb_speed_amount""120")  // The amount of speed boost given
    
cvar_speed_time register_cvar("fb_speed_time""30.0")  // The time given speed boost
    
cvar_e13 register_cvar("fb_enable_jump_reward""0")  // Enable multi-jump reward
    
cvar_jump register_cvar("fb_jump_amount""3")  // The amount of multi-jump given
    
cvar_jump_time register_cvar("fb_jump_time""30.0")  // The time given for god mode
    #if defined IM_USING_ZP
    
cvar_e14 register_cvar("fb_enable_ap_reward""0")  // Enable ammo pac2 reward
    
cvar_ap register_cvar("fb_ap_amount""5")  // The amount of ammo pac2 given
    #endif 
Reminder:

Please don't forget to add the "firstblood.wav in the sound/misc folder. If you do not have the sound, just download it from below.

Installation:
1. Just download the custom include from here: https://forums.alliedmods.net/showthread.php?t=245805 (Please read the requirement section below!).

2. Then, download and compile the fb_2.sma file.

3. Lastly, just put the firstblood.cfg file in the configs folder. ;)
Requirements:
1. cs_core.inc file.
2. cs_core.sma file.
3. cs_reward.sma file.
4. Zombie Plague (If you want to use this for Zombie Plague mode).
All of the requirement files can be downloaded from here: https://forums.alliedmods.net/showth...hp?t=245805#17


First Blood v2

Quote:
This version is a different version from fb_2.sma file. Now, all the rewards is being given randomly.

The value can be modified using the same firstblood.cfg file. The different is you will never know what you will get as a reward when you be the first person drew the blood.

This will make the gameplay more fun as you cannot predict exactly what you will get. ;)

If you want this version, just download fb_3.sma file.
Credits:
Quote:
1. HamletEagle
2. H.RED.ZONE for code helping.
3. Just4Games for the suggestion.
4. etc
To do list:
Quote:
If anyone have any suggestions, feel free to share it.
Changelog:
Quote:
(17/7/2014):
v1.0 - First release
v1.1 - [FIXED] The ways of the sounds is being played.

(18/7/2014):
v1.2 - [FIXED] Removed the cstrike include as it is not being used for this plugin.

(19/7/2014):
v1.3 - [FIXED] Health bonus will works perfectly after first killing.

(25/7/2014)
v2.0 - [ADDED] First blood bonus can be disabled for zombie.

(27/7/2014)
v2.1 - [FIXED] The hud message will only be appeared to the first killer.

(29/7/2014)
v1.0.1 - First release of First Blood Reward v2

(30/7/2014)
v1.0.2 - [FIXED] The hud message will be displayed to all players
v1.0.3 - [FIXED] The hud message will only be displayed if real player killed a victim

(1/8/2014)
v3.0 (Beta) - [FIXED] Fully recoded and optimized both of the plugin first_blood_bonus and first_blood_bonus_v2

(2/8/2014)
v3.3 (Beta) - [FIXED] Fully rearranged and optimized both of the plugin first_blood_bonus and first_blood_bonus_v2
v3.4 (Beta) - [ADDED] 3 different colour that will be randomly chosen for the hud message
v3.5 (Beta) - [ADDED] New support for csbot/bot from CZ

(8/8/2014)
v4.0 - [FIXED] Optimizing the code and fix the erorr on line 18.

(9/8/2014)
v4.1 - [ADDED] Cvar to enable or disable the health, armor and ammo packs reward.

(10/8/2014)
v4.2 - New release of first_blood_bonus_v3.
v4.2 - [OPTIMIZED] Remove unnecessary code.

(10/11/2014)
v5.0 - New release of fb_2.

(11/11/2014)
v5.0 v2 - New release of fb_3

(26/11/2014)
v5.1 - [FIXED] Change the get_pcvar_num to get_pcvar_float for health and armor reward due to latest update of CS Core + Reward API. ;)

(1/12/2014)
v5.2 - [FIXED] The glow and aura reward natives due to latest update of CS Core + Reward API. ;)

(6/12/2014)
v5.3 - [FIXED] The grenade reward natives due to latest update of CS Core + Reward API. ;)
Download:
Quote:
v3.5 (Beta) - first_blood_bonus (2) || first_blood_bonus_v2 (10)
v4.0 - first_blood_bonus (3) || first_blood_bonus_v2 (3)
v4.1 - first_blood_bonus (1) || first_blood_bonus_v2 (2)
v4.2 - first_blood_bonus (37) || first_blood_bonus_v2 (34) || first_blood_bonus_v3 (60)
Attached Files
File Type: zip sound.zip (20.4 KB, 387 views)
File Type: cfg firstblood.cfg (4.3 KB, 285 views)
File Type: sma Get Plugin or Get Source (fb_2.sma - 458 views - 6.6 KB)
File Type: sma Get Plugin or Get Source (fb_3.sma - 586 views - 5.2 KB)
__________________
Problem with ZP?
ZP Helper!

Last edited by zmd94; 12-06-2014 at 03:11.
zmd94 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-16-2014 , 16:16   Re: [ZP] First Blood Reward v1.0
Reply With Quote #2

Idea is solid and i like this one, just to make it more better use bits and not bool it's more efficient. (:
__________________
H.RED.ZONE is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-16-2014 , 16:21   Re: [ZP] First Blood Reward v1.0
Reply With Quote #3

Quote:
Originally Posted by H.RED.ZONE View Post
Idea is solid and i like this one, just to make it more better use bits and not bool it's more efficient. (:
Thank you for the suggestion. I will update and optimize this plugin.
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Old 07-16-2014 , 16:44   Re: [ZP] First Blood Reward v1.0
Reply With Quote #4

Code:
emit_sound( 0, CHAN_AUTO, "misc/firstblood.wav", 0.7, ATTN_NORM, 0, PITCH_NORM );
Change to
Code:
client_cmd(0, "spk misc/firstblood.wav");
You will hear many sounds if you play using emit_sound. Use client_cmd is enough.
__________________
Hi, 7 years ago i run nosteam servers and i support nosteam community. So please ban me. Thank you legitmodders.
yokomo is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-16-2014 , 16:49   Re: [ZP] First Blood Reward v1.0
Reply With Quote #5

Quote:
Originally Posted by yokomo View Post
Code:
emit_sound( 0, CHAN_AUTO, "misc/firstblood.wav", 0.7, ATTN_NORM, 0, PITCH_NORM );
Change to
Code:
client_cmd(0, "spk misc/firstblood.wav");
You will hear many sounds if you play using emit_sound. Use client_cmd is enough.
Thank you for helping to optimize this plugin. I will update this plugin and add credit for you.
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-17-2014 , 06:27   Re: [ZP] First Blood Reward v1.0
Reply With Quote #6

What you have against emit_sound ? It's working just fine.
"You will hear many sounds if you play using emit_sound" - I don't have this problem.

zmd, just a suggestion: indent your code.

Last edited by HamletEagle; 07-17-2014 at 06:34.
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-17-2014 , 06:37   Re: [ZP] First Blood Reward v1.0
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
What you have against emit_sound ? It's working just fine.
May I ask? If we want to compare, which one is better:
Quote:
1. Just using emit_sound.
2. or using cliend_cmd.
Quote:
Originally Posted by HamletEagle View Post
Just a suggestion: indent your code.
Thank you. I will update the code.
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 07-17-2014 , 09:07   Re: [ZP] First Blood Reward v1.0
Reply With Quote #8

"client_cmd" is more efficient in this case because you want to play your sound to every user, in case you wanted to create a radius for sound to be played then "emit_sound" is better, so as i said in this plugin it's better to use client_cmd to play it to all players and not do anything to change the core sound or emit it in radius.
__________________
H.RED.ZONE is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-17-2014 , 09:54   Re: [ZP] First Blood Reward v1.0
Reply With Quote #9

Quote:
Originally Posted by H.RED.ZONE View Post
"client_cmd" is more efficient in this case because you want to play your sound to every user, in case you wanted to create a radius for sound to be played then "emit_sound" is better, so as i said in this plugin it's better to use client_cmd to play it to all players and not do anything to change the core sound or emit it in radius.
Thank you for the explanation. This will help me a lot as I'm still learning.
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Old 07-17-2014 , 16:11   Re: [ZP] First Blood Reward v1.0
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
What you have against emit_sound ? It's working just fine.
"You will hear many sounds if you play using emit_sound" - I don't have this problem.

zmd, just a suggestion: indent your code.
Yes you will have this problem when 31 players stay near you and you can hear a very loud sound, because it play for all players in you server. client_cmd only play for one client, i mean individual.
__________________
Hi, 7 years ago i run nosteam servers and i support nosteam community. So please ban me. Thank you legitmodders.
yokomo 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 09:19.


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