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 11-25-2014 , 13:03   Re: [API] CS Core + Reward v4.8 (18 Rewards + 4 Forwards)
Reply With Quote #101

Alright, I appreciate it. ;)

I will update the code.
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-26-2014 , 00:01   Re: [API] CS Core + Reward v4.9 (18 Rewards + 4 Forwards)
Reply With Quote #102

New update!
Quote:
- [ADDED] An option to disable or enable the custom chat message from the cs_reward.sma file.
- [ADDED] New debug messages for each param of each native. So, it will be more easier to detect any problems.
- [ADDED] New check for certain param to prevent crash problem.
- [FIXED] Remove the unnecessary variables.
- [FIXED] Remove completely get_maxplayers code in cs_core.sma file. Now, it is using get_players.
- [FIXED] Change the integer number of health and armor reward to float number. ;)
- [FIXED] Improve the arrangement and readability of the codes.
Screenshot:


zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-30-2014 , 23:20   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #103

New update!
Quote:
- [ADDED] An option to change values of color for glow, aura, line and ring indicator reward.
- [ADDED] An option to change the way of line and ring indicator reward is working. Now, you can search the nearest player instead all alive players. ;)
Reward API:
PHP Code:
/*
 * This is to give glow rewards.
 * param id - ID of client
 * param iValue - if you set it to 0, it will restore the reward
 * param const g_iColor[] - is color of glow
 * param iType - if you set it to 0, it will give permanent glow
 * param Float:fGlowT - the durations of the reward
*/
native cs_glow_reward(idiValue, const g_iColor[], iTypeFloat:fGlowT);

/*
 * This is to give aura rewards
 * param id - ID of client
 * param iValue - if you set it to 0, it will restore the reward
 * param const g_iColor[] - is color of aura
 * param iType - if you set it to 0, it will give permanent aura
 * param Float:fAuraT - the durations of the reward
*/
native cs_aura_reward(idiValue, const g_iColor[], iTypeFloat:fAuraT);

/*
 * This is to give line drawing rewards
 * param id - ID of client
 * param iValue - if you set it to 0, it will restore the reward
 * param g_iFindLine - allow you to configure the finding. 0; All alive players || 1; Nearest player
 * param const g_iColor[] - is color of line
 * param iType - if you set it to 0, it will give permanent line drawing
 * param Float:fLineT - the durations of the reward
*/
native cs_line_reward(idiValueg_iFindLine, const g_iColor[], iTypeFloat:fLineT);

/*
 * This is to give ring indicator rewards
 * param id - ID of client
 * param iValue - if you set it to 0, it will restore the reward
 * param g_iFindRing - allow you to configure the color. 0; All alive players || 1; Nearest player
 * param const g_iColor[] - is color of ring
 * param iType - if you set it to 0, it will give permanent ring indicator
 * param Float:fRingT - the durations of the reward
*/
native cs_ring_reward(idiValueg_iFindRing, const g_iColor[], iTypeFloat:fRingT
"Reward API" tutorial:
Code:
J. GLOW:
1. cs_glow_reward(id, 0, "", 0, 0.0) = It will restore the glow. 2. cs_glow_reward(id, 1, "255 0 0", 0, 0.0) = The glow reward is permanent. 3. cs_glow_reward(id, 1, "255 0 0", 1, 30.0) = It will give glow for 30 seconds only.
K. AURA:
1. cs_aura_reward(id, 0, "", 0, 0.0) = It will restore the aura. 2. cs_aura_reward(id, 1, "255 0 0", 0, 0.0) = The aura reward is permanent. 3. cs_aura_reward(id, 1, "255 0 0", 1, 30.0) = It will give aura for 30 seconds only.
Q. LINE-DRAWING:
1. cs_line_reward(id, 0, 0, "", 0, 0.0) = It will restore the line drawing. 2. cs_line_reward(id, 1, 0, "255 0 0", 0, 0.0) = The line drawing reward is permanent and will search all alive players. 3. cs_line_reward(id, 1, 1, "255 0 0", 0, 0.0) = The line drawing reward is permanent and and will search nearest alive players only. 4. cs_line_reward(id, 1, 0, "255 0 0", 1, 30.0) = It will give line drawing for 30 seconds only and will search all alive players. 5. cs_line_reward(id, 1, 1, "255 0 0", 1, 30.0) = It will give line drawing for 30 seconds only and will search nearest alive players only.
R. RING INDICATOR:
1. cs_ring_reward(id, 0, 0, "", 0, 0.0) = It will restore the ring indicator. 2. cs_ring_reward(id, 1, 0, "255 0 0", 0, 0.0) = The ring indicator reward is permanent and will search all alive players. 3. cs_ring_reward(id, 1, 1, "255 0 0", 0, 0.0) = The ring indicator reward is permanent and will search nearest alive players only. 4. cs_ring_reward(id, 1, 0, "255 0 0", 1, 30.0) = It will give ring indicator for 30 seconds only and will search all alive players. 5. cs_ring_reward(id, 1, 1, "255 0 0", 1, 30.0) = It will give ring indicator for 30 seconds only and will search nearest alive players only.

Last edited by zmd94; 11-30-2014 at 23:21.
zmd94 is offline
deadflush
Member
Join Date: Mar 2013
Old 11-30-2014 , 23:35   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #104

Very Nice Keep it up!
deadflush is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-30-2014 , 23:41   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #105

I appreciate it. ;)
zmd94 is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 12-02-2014 , 14:19   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #106

About cs core, why this: cs_is_terrorist(id)?
Its better to use get_user_team or cs_get_user_team.

About rewards, please do something about this. You force people to use all rewards. Make defines or something to know what rewards people want to use. Let's say i want to use jump reward and i am not interested in the others rewards. The server will register and call functions with no need at all (It's a waste of CPU - I know you are a zombie player and zombie players don't care about cpu, but some people care ).

Anyway, you are doing a good job. Keep on it! (Stealing your wink )
__________________
Jhob94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-03-2014 , 08:31   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #107

Jhob94, I appreciate your suggestion. The code will be updated. ;)
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-03-2014 , 09:25   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #108

A possible way:

Code:
new CBasePlayerJumpHook //In the jump native if(!CBasePlayerJumpHook) {     CBasePlayerJumpHook = RegisterHam(Ham_Jump, "player", "CBasePlayer_Jump") }
__________________
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-03-2014 , 09:43   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #109

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
new CBasePlayerJumpHook

//In the jump native
if(!CBasePlayerJumpHook)
{
    
CBasePlayerJumpHook RegisterHam(Ham_Jump"player""CBasePlayer_Jump")

Sorry, may you explain a little bit about this?

By the way, should I do such below?
PHP Code:
// Just uncomment reward that you want to use. ;)
//#define HEALTH_REWARD
//#define ARMOR_REWARD
//#define MONEY_REWARD
//#define INVI_REWARD
//#define NOCLIP_REWARD
//#define NADE_REWARD
//#define WEAPON_REWARD
//#define DEADLY_SHOT_REWARD
//#define GLOW_REWARD
//#define AURA_REWARD
//#define GODMODE_REWARD
//#define JUMP_REWARD
//#define SPEED_REWARD
//#define UNLIMITED_BULLET_REWARD
//#define NORECOIL_REWARD
//#define LINE_REWARD
//#define RING_REWARD 
Or there is other proper way to do it?

Last edited by zmd94; 12-03-2014 at 10:21.
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-03-2014 , 11:47   Re: [API] CS Core + Reward v5.0 (18 Rewards + 4 Forwards)
Reply With Quote #110

I'm thinking of a way in which you can have your forwards registered only when needed, without editing the main file. Right now you are registering them in init, and they will be called even if no native need them. My point is that you can register them only when the native is called, and to avoid registering it every time, we create a variable which we will check, if 0 register the forward, if > 0 forward already registered, do nothing.
__________________

Last edited by HamletEagle; 12-03-2014 at 14:39.
HamletEagle 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 06:28.


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