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 04-14-2015 , 19:51   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #171

I appreciate it. Feel free to use it. If there are any problems, just let me know.
zmd94 is offline
happy_2012
Senior Member
Join Date: Aug 2012
Old 04-16-2015 , 19:41   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #172

Why don't you make a print_color.inc file instead of writing the function of print_color in each of your plugins?
__________________
Discord contacts:
I rarely look at private messages here, but I am very active on Discord!
happy_2012 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 04-16-2015 , 21:30   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #173

It is because I don't think it is really necessary. Yet, what is your opinion about this plugin? Any comments or suggestions?

Last edited by zmd94; 04-16-2015 at 21:30.
zmd94 is offline
happy_2012
Senior Member
Join Date: Aug 2012
Old 04-16-2015 , 23:44   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #174

I must say that your plugin(s) are quite impressive ;)

I recommend you add errors on these API functions and return -1 instead of 0 ;)
PHP Code:
public native_is_terrorist(iPluginiParams)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
        return 
0
    
    
return flag_get_boolean(g_isTerroristid);
}

public 
native_is_last_terrorist(iPluginiParams)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
        return 
0
    
    
return flag_get_boolean(g_iLastTerroristid);
}

public 
native_is_last_counter(iPluginiParams)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
        return 
0
    
    
return flag_get_boolean(g_iLastCounterid);

to ->

PHP Code:
public native_is_terrorist(iPluginiParams)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
    {
        
log_error(AMX_ERR_NATIVE"[CS] Player is not connected (%d)"id)
        return -
1
    
}
    
    return 
flag_get_boolean(g_isTerroristid);
}

public 
native_is_last_terrorist(iPluginiParams)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
    {
        
log_error(AMX_ERR_NATIVE"[CS] Player is not connected (%d)"id)
        return -
1
    
}
    
    return 
flag_get_boolean(g_iLastTerroristid);
}

public 
native_is_last_counter(iPluginiParams)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
    {
        
log_error(AMX_ERR_NATIVE"[CS] Player is not connected (%d)"id)
        return -
1
    
}
    
    return 
flag_get_boolean(g_iLastCounterid);

some people might want to know what and why is the error being thrown.
__________________
Discord contacts:
I rarely look at private messages here, but I am very active on Discord!
happy_2012 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 04-16-2015 , 23:56   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #175

I appreciate your suggestion. ;)
zmd94 is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-17-2015 , 06:12   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #176

How do you get these stats ? https://forums.alliedmods.net/showpo...&postcount=112
Seem insteresting.
Kz1.0 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 04-17-2015 , 06:31   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #177

Just visit below thread:

https://forums.alliedmods.net/showthread.php?t=67752
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-09-2015 , 09:00   Re: [API] CS Core + Reward v6.1 (21 Rewards + 4 Forwards)
Reply With Quote #178

So, any suggestions or comments for improvement?
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 07-24-2015 , 04:03   Re: [API] CS Reward v6.1 (21 Rewards)
Reply With Quote #179

Codes now is at GitHub:


Last edited by zmd94; 07-24-2015 at 04:04.
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-09-2015 , 09:59   Re: [API] CS Reward v6.1 (21 Rewards)
Reply With Quote #180

Even if your code would be perfect this does not change the fact that's an API for something like that is silly.
Why ? What you do here is just to make some wrappers for default functions and to copy/paste some plugins together. API should provide some better handling or a better control on some context, it could also facilitate access to something that would be hard to accomplish without, but this does not mean it should be a lazy error checker.

For example:
1.cs_health_reward -> set_user_health
2.cs_armor_reward -> set_user_armor
3.cs_money_reward -> cs_set_user_money(just a matter to change m_iAccount offset).
4.cs_invisible_reward -> set_user_rendering
5.cs_noclip_reward -> set_user_noclip.
6.cs_grenade_reward -> give_item
7.cs_weapon_reward -> give_item + cs_set_user_bpammo.
8.cs_godmode_reward -> set_user_godmode.
9.cs_glow_reward -> set_user_rendering
10.cs_gravity_reward -> set_user_gravity.
11.cs_speed_reward -> set_user_maxspeed + ItemPreFrame().

The other natives are just random copy/paste from other plugins. Some of them may make sense, like cs_istrap.

1.cs_fw_spawn_post -> Ham_Spawn
2.cs_fw_first_blood -> few checks + Ham_Killed.
3.cs_is_terrorist -> get_user_team
4.cs_get_terrorist_count -> get_players + e flag
5.cs_get_counter_count -> get_players + e flag

I don't want to be rude, but I don't see the point of such API. So, if you want this to have any chances of being considered usefull think to add stuffs that make sense from the POV of an API.
__________________

Last edited by HamletEagle; 09-09-2015 at 09:59.
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 00:32.


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