Raised This Month: $328 Target: $400
 82%   Almost there!

[API] CS Reward v6.1 (21 Rewards)


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-07-2014 , 07:33   [API] CS Reward v6.1 (21 Rewards)
Reply With Quote #1

[API]
CS Core + Reward v6.1

(21 Rewards + 4 Forwards)


Status:
UP-TO-DATE
(4/1/2015)



Contents:
Description
What new!
4 new forwards
How to use the "CS Core API"?
How to use the "Reward API"?
Reward API tutorial
List of CS Core API
List of Reward API
Example
Problems. ;)
Error 010: Invalid Function or Declaration?
How to disable the chat message?
Installation
Other features
Credits
To do list
Changelogs
Screenshots
Downloads
Other tutorials. ;)
1. How to configure cooldown for permanent reward? (New!)
2. RGB to color name mapping. Just visit this website to configure the values for the color. ;)
(New!)
Plugins using this API. ;)
1. Premium Member ;)
2. First Blood Bonus (ZP Compatible).
3. Free Weapon.
4.
Terrorist Ability.
5. Free Glow (ZP Compatible).
6. Last 2 Players.
7. Rewards Shop. ;)
8. CS Score.
9. Credit Time (Now, you will recieve credit for playing X amount of time in the server) (Just send me a personal message)
Donation. ;)

Description:Top

This plugin will allow you to give reward or bonus easily. Just use the CS Core API. As example, just download c_24.sma file to see how I'm using the CS Core API. ;)

What new!Top
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.
14. Unlimited clip reward.
15. Unlimited BP ammo reward.
16. No-recoil reward.
17. Line drawing reward. (This simulates a sort of ability by drawing a line between you and the enemy.) Screenshots. ;)
18. Ring indicator reward. (This ability start at enemy feet and expanded outwards into a much larger sort of ring.) Screenshots. ;)
19. Gravity reward. (New!)
20. Trail reward. (New!) Screenshots. ;)
21. Wall ability reward. (New!) (This ability allow player to penetrate the wall. It is not the same with no-clip.) Screenshots. ;)
Quote:
Deadly Shot is a firepower enhancement item. The user's firepower will be boosted to deal headshot damages and also score headshot kills.
4 New Forwards:Top
PHP Code:
/**
 * This is called during a player spawn
 * param id - ID of client
 */
forward cs_fw_spawn_post(id);

/**
 * This is called when a player becomes the last terrorists
 * param id - ID of client
 */
forward cs_fw_last_terrorist(id)

/**
 * This is called when a player becomes the last counter-terrorists
 * param id - ID of client
 */
forward cs_fw_last_counter(id)

/**
 * This is called when a player has drew the first blood
 * param victim - ID of client
 * param attacker - ID of client
 */
forward cs_fw_first_blood(victimattacker); 
If you want to see how to use this forward, just download the c_24.sma file.

How to use the "CS Core API"?Top

Just download the c_24.sma file to see how I'm using the CS Core API. ;)

Just say /core in your chat. Yet, this command only available for player that has specific flag. If you want to configure the flag, just open the c_24.sma file, then edit below part:
PHP Code:
// Configure which flag will have access to the reward menu
#define ADMIN_FLAG ADMIN_IMMUNITY 
Then, a menu will be opened such below screenshots:





How to use the "Reward API"?Top

Just download the c_24.sma file. You also can try the reward by yourself.

Just say /rm in your chat. Yet, this command only available for player that has specific flag. If you want to configure the flag, just open the c_24.sma file, then edit below part:
PHP Code:
// Configure which flag will have access to the reward menu
#define ADMIN_FLAG ADMIN_IMMUNITY 
Then, a menu will be opened such below screenshots:





"Reward API" tutorial:Top
-->
List of CS Core API:Top
-->
List of Reward API:Top
-->
Example. ;)Top
-->
Error 010: Invalid Function or Declaration?
Top


If you encountered this problem, it mean that you have edited the file and encoded it in the incorrect format. So the solution is:
-->
How to disable the chat message?Top

Now, there is an option to disable or enable custom chat message from the cs_reward.sma file. Just open the cs_reward.sma file, the edit this part:
PHP Code:
//Just uncomment 'CUSTOM_MESSAGE' if your want to enable custom message from cs_reward.sma
#define CUSTOM_MESSAGE 
Installation:Top
1. Just put the cs_core.inc in the include folder. This is crucial.

2. Next, compile the cs_core.sma file. Then, put the .amxx file in the plugin folder. If you just want to use the Reward API, no need to download this.

3. Then, compile the cs_reward.sma file. Then, put the .amxx file in the plugin folder. If you just want to use the CS Core API, no need to download this.

3. Lastly, just compile the c_24.sma file (if you want to test the reward) and put the .amxx file in the plugin folder to see how the CS Core API is working. This is just for example. If you just want to use the CS Core or Reward API in your code, no need to download this.

4. Or you can just use your creativity on how to give the reward to the players or using the forward. Have fun!
Other features:Top

All of the rewards has been designed to do below things:
1. Reset all rewards automatically when the player that recieved it is disconnet.

2. Reset all rewards automatically when the player that recieved it has been killed.

3. Reset all rewards automatically at new round.

4. Reset all rewards automatically at every respawn.

5. Prevent the reward from being given to dead player.

6. Prevent the reward from being given if the native is not being used correctly.
Credits:Top
Quote:
1. WBYOKOMO for his parachute API.
2. Kia for code helping.
3. Jhob94 for code helping and idea.
4. Dar2_Siders for his ideas.
5. v3x for line drawing method.
6. HamletEagle for code helping. ;)
7. Blizzard_87 for spending his time to teach me about API as I'm still newbie. ;)
8. ZP Dave Team for forward method.
9. Xalus for wall ability code. ;)
10. etc
To do list:Top
Quote:
If anyone have any suggestions, feel free to share it.
Changelogs:Top
-->
Screenshots:Top
-->

Downloads:Top
-->
Plugins using this API:Top
1. Premium Member ;)
2. First Blood Bonus (ZP Compatible).
3. Free Weapon.
4.
Terrorist Ability.
5. Free Glow (ZP Compatible).
6. Last 2 Players.
7. Rewards Shop. ;)
8. CS Score.
9. Credit Time (Now, you will recieve credit for playing X amount of time in the server) (Just send me a personal message)

Donation. ;)Top


Donate in EUR. ;)

Codes now is at GitHub:

Just visit this site. \o/
Attached Files
File Type: inc cs_core.inc (8.8 KB, 447 views)
File Type: sma Get Plugin or Get Source (c_24.sma - 322 views - 17.3 KB)
File Type: sma Get Plugin or Get Source (cs_core.sma - 409 views - 6.1 KB)
File Type: sma Get Plugin or Get Source (cs_reward.sma - 553 views - 64.4 KB)
__________________
Problem with ZP?
ZP Helper!

Last edited by zmd94; 10-11-2015 at 12:36.
zmd94 is offline
Old 08-07-2014, 14:08
Br0k3nPh1LL1p
This message has been deleted by Br0k3nPh1LL1p. Reason: nvm
Br0k3nPh1LL1p
Junior Member
Join Date: Apr 2013
Location: Serbia, Belgrade
Old 08-07-2014 , 14:20   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #2

I commented this (because i get error (i use 1.8.2) ) :

PHP Code:
    //#if defined AMXX_VERSION_NUM < 183
    //RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 0, true)
    //#else
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
//#endif 
And it compiled perfectly. Tested on my listen server ZPA and every time a person infects (not by gun) they dont get rewards (perfect!)
And ofc by gun they get HP, AP and Money!
Good Work!

EDIT: Also tested with bots, same result!
__________________

Last edited by Br0k3nPh1LL1p; 08-07-2014 at 14:24.
Br0k3nPh1LL1p is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Portugal
Old 08-07-2014 , 14:33   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #3

Quote:
Originally Posted by Br0k3nPh1LL1p View Post
I commented this (because i get error (i use 1.8.2) ) :

PHP Code:
    //#if defined AMXX_VERSION_NUM < 183
    //RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 0, true)
    //#else
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
//#endif 
And it compiled perfectly. Tested on my listen server ZPA and every time a person infects (not by gun) they dont get rewards (perfect!)
And ofc by gun they get HP, AP and Money!
Good Work!

EDIT: Also tested with bots, same result!
When you infect someone in zp, he doesnt dies. And since he isnt using zp include for detect infections, ofc it will detect first human kill.

Anyway i would suggest you to add zp support to next version. And if running for zp, use cvars if only want ct kills or infections too. Instead of give money, give ap.
__________________
Jhob94 is offline
Br0k3nPh1LL1p
Junior Member
Join Date: Apr 2013
Location: Serbia, Belgrade
Old 08-07-2014 , 14:40   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #4

Quote:
Originally Posted by Jhob94 View Post
When you infect someone in zp, he doesnt dies.
I totally forgot about that lol

Quote:
Originally Posted by Jhob94 View Post
And since he isnt using zp include for detect infections, ofc it will detect first human kill.
I should have noticed that..

Quote:
Originally Posted by Jhob94 View Post
Anyway i would suggest you to add zp support to next version. And if running for zp, use cvars if only want ct kills or infections too. Instead of give money, give ap.
I was just checking this, and this might be perfect!

Thanks for the reply!
__________________
Br0k3nPh1LL1p is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-07-2014 , 14:54   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #5

@ Br0k3nPh1LL1p, this plugin can be used for ZP. However, it only detected the killed made by human not the zombie.
Quote:
Originally Posted by Jhob94 View Post
Anyway I would suggest you to add ZP support to next version. And if running for ZP, use cvars if only want CT kills or infections too. Instead of give money, give ammo packs.
Thank you for the suggestion.
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-07-2014 , 15:54   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #6

Well, the money are stated as "bonus", but you actually don't add it to the money that player already has. I'm talking about:
PHP Code:
cs_set_user_money(attackeriReward
Also, you can store the first three checks in Ham_Killed handler as one:
PHP Code:
if(bFirstBlood || victim == attacker || !is_user_connected(attacker)) 
        return; 
The plugin seems to be pretty useful and pottentially good coded. Keep it on!
__________________

Last edited by Flick3rR; 08-07-2014 at 15:55.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-07-2014 , 16:25   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #7

Quote:
Originally Posted by Flick3rR View Post
but you actually don't add it to the money that player already has.
PHP Code:
cs_set_user_money(attackeriReward
Sorry, can you explain a little bit?
Quote:
Originally Posted by Flick3rR View Post
Also, you can store the first three checks in Ham_Killed handler as one:
PHP Code:
if(bFirstBlood || victim == attacker || !is_user_connected(attacker)) 
        return; 
Thank you for optimizing this code.
Quote:
Originally Posted by Flick3rR View Post
The plugin seems to be pretty useful and pottentially good coded. Keep it on!
Thank you very much.
__________________
Problem with ZP?
ZP Helper!

Last edited by zmd94; 08-07-2014 at 16:32.
zmd94 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 08-07-2014 , 16:27   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #8

I meant that you directly set that ammount of money to the user and don't add it to his current money. And if I have 15000 and make first blood, my money won't get 15500, but 500. And I loose 14500
It should be:
PHP Code:
cs_set_user_money(attackerget_user_money(attacker) + iReward
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-07-2014 , 16:34   Re: First Blood Reward v1.0 (Bot Support)
Reply With Quote #9

Quote:
Originally Posted by Flick3rR View Post
And if I have 15000 and make first blood, my money won't get 15500, but 500. And I loose 14500.
LOL, my silly mistakes.

Thank you for correcting me.

Quote:
Originally Posted by Flick3rR View Post
It should be:
PHP Code:
cs_set_user_money(attackerget_user_money(attacker) + iReward
Now, I understand. Thank you for helping.

Edit: Flick3rR, I think the should be like this, right?
PHP Code:
cs_set_user_money(attackercs_get_user_money(attacker) + iReward
__________________
Problem with ZP?
ZP Helper!

Last edited by zmd94; 08-07-2014 at 16:43.
zmd94 is offline
Old 08-07-2014, 16:37
Jhob94
This message has been deleted by Jhob94. Reason: Too late xD
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 08-07-2014 , 16:50   Re: First Blood Reward v1.3 (Bot Support)
Reply With Quote #10

New update!
Quote:
v1.2 - [FIXED] Optimizing the code.
v1.3 - [FIXED] The code for giving money.
Feel free to test it. If there are any problems, just inform me. Then, I will do my best to fix it.
__________________
Problem with ZP?
ZP Helper!

Last edited by zmd94; 08-07-2014 at 16:51.
zmd94 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 05:31.


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