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

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


Post New Thread Reply   
 
Thread Tools Display Modes
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-29-2014 , 20:44   Re: [DN] CS Reward v3.2 (11 Different Rewards)
Reply With Quote #61

By the way, I will make a new section about this problem.

If anyone encountered this problem, then the solution is as follow:
Quote:
Originally Posted by YamiKaitou View Post
Encode the file as UTF8 without BOM

Last edited by zmd94; 10-29-2014 at 20:47.
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-31-2014 , 21:10   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #62

New update!
Quote:
(1/11/2014)
v3.3 - [ADDED] Add 2 new rewards which are multi-jump reward and speed boost reward.
zmd94 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-01-2014 , 05:21   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #63

Your code is acceptable, but let me ask you one thing: What's the point of this plugin? Is it just to give players super powers? That's not very original, considering where plugins like yours end up.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-01-2014 , 05:33   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #64

The main idea is to allow other coders to use the native to give reward.

It can be used in any other reward plugin as example when when we want to give speed boost reward when someone killed somebody with a headshot, then we just use the native cs_speed_reward(id).

As example, I have used the native to give reward to the first killer. It is very easy to use.

Last edited by zmd94; 11-01-2014 at 05:36.
zmd94 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 11-01-2014 , 05:39   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #65

Your bonuses are still hardcoded though, so they're kind of meaningless in the long run. Why don't you just create an API system to register those kind of rewards, then a subplugin that adds the basic set of them, which you're advertising in the thread? As long as it doesn't exist yet, that'd be way more interesting.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-01-2014 , 05:46   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #66

Quote:
Originally Posted by Backstabnoob View Post
Your bonuses are still hardcoded though, so they're kind of meaningless in the long run. Why don't you just create an API system to register those kind of rewards, then a subplugin that adds the basic set of them, which you're advertising in the thread? As long as it doesn't exist yet, that'd be way more interesting.
An API system for reward would be nice!

By the way, you are right, the bonuses are hardcoded, so they're kind of meaningless in the long run.

I will try to change it into API.

Last edited by zmd94; 11-01-2014 at 07:30.
zmd94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-01-2014 , 10:31   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #67

You can do something like this, seems useful:

API
PHP Code:
/*    Copyright © 2014, zmd94.

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <hamsandwich>

//Uncomment this if you are using new amxmodx 1.8.3 that support register ham for csbot/bot from CZ.
//#define Use_New_Amxx_183

new bool:bFirstBlood
new g_fwFirstBloodg_fwDummyResult

public plugin_init() 
{
    
register_plugin("First Blood Bonus (API)""3.0""zmd94")
    
    
g_fwFirstBlood CreateMultiForward("first_blood"ET_IGNOREFP_CELLFP_CELL)
        
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
    
#if defined Use_New_Amxx_183
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled"0true)
    
#else
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
#endif
}

public 
event_new_round()
{
    
bFirstBlood false
}

public 
fw_PlayerKilled(victimattacker)  
{
    if(
bFirstBlood || !is_user_alive(attacker) || victim == attacker
        return;
    
    
bFirstBlood true
    
    ExecuteForward
(g_fwFirstBloodg_fwDummyResultvictimattacker)


first_blood.inc
PHP Code:
/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    ---------------------------------------
    -:-         First Blood API         -:-
    ---------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */

forward first_blood(victimattacker); 

sub-plugin example for hud and sound
PHP Code:
#include <amxmodx>
#include <first_blood>

new const FirstBlood[] = "misc/firstblood.wav"

public plugin_init() 
{
    
register_plugin("First Blood Bonus (Hud & Sound)""3.0""zmd94")
}

public 
plugin_precache()
{
    
precache_sound(FirstBlood)
}

public 
first_blood(victimattacker)  
{    
    new 
szName[32], szName2[32], iColor[3]
    
get_user_name(attackerszNamecharsmax(szName)) 
    
get_user_name(victimszName2charsmax(szName2)) 
    
    
iColor[0] = random_num(10,255)
    
iColor[1] = random(256)
    
iColor[2] = random(256)
    
    
set_hudmessage(iColor[0], iColor[1], iColor[2], -1.00.2006.012.00.00.0, -1)
    
show_hudmessage(0,"%s drew a first blood^nFirst victim is %s!"szNameszName2)
    
    
client_cmd(0"spk %s"FirstBlood)

__________________
Jhob94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-01-2014 , 10:44   Re: [DN] CS Reward v3.3 (13 Different Rewards)
Reply With Quote #68

I appreciate your help, Jhob94. This give me idea on how to start working on it. ;)
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-05-2014 , 04:19   Re: [API] CS Reward v4.0 (13 Different Rewards)
Reply With Quote #69

[API]

CS Reward v4.0
(13 Different Rewards)


Status:
UP-TO-DATE (5/11/2014)

New update!

Quote:
(5/11/2014)
v4.0 - Releasing the Reward API. ;)
Credits:
Quote:
1. WBYOKOMO for his parachute API.
2. Blizzard_87 for spending his time to teach me about API as I'm still newbie. ;)
Lastly, my special credit to ARKSHINE for the advice. ;)

Last edited by zmd94; 11-05-2014 at 04:20.
zmd94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 11-05-2014 , 04:40   Re: [API] CS Reward v4.0 (13 Different Rewards)
Reply With Quote #70

The amount of possible rewards is unknow, infinite i would say. Will you add all into this? I believe it makes more sense to make an api to register forward at first blood and then make sub-plugins with rewards. Seems to be a way more useful.
__________________
Jhob94 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 20:23.


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