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

[CS1.6|CZ] Random C4 Time


Post New Thread Reply   
 
Thread Tools Display Modes
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-05-2011 , 11:41   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #11

Update 0.0.3
Dark Style is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-09-2011 , 04:55   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #12

Code:
    if ( UTIL_FindEntityByClassname( NULL, "func_bomb_target" ) )
    {
        m_bMapHasBombTarget = true;
        m_bMapHasBombZone   = true;
    }
    else if ( UTIL_FindEntityByClassname( NULL, "info_bomb_target" ) )
    {
        m_bMapHasBombTarget = true;
    }
You forgot to check 1 bomb target class ;)
Also your check <0 is bad, should be <=0

PHP Code:
if(engfunc(EngFunc_FindEntityByString, -1"classname""func_bomb_target") < 0
->
PHP Code:
    if(    engfunc(EngFunc_FindEntityByStringFM_NULLENT"classname""func_bomb_target") <= 0
    
&&    engfunc(EngFunc_FindEntityByStringFM_NULLENT"classname""info_bomb_target") <= 0    )
    {
    } 
May be you could remove that check so an additional module wouldn't be required, your choice.

Also, don't use set_fail_state which implies that there is a problem with the plugin (missing a required file or something like that), just use pause native instead, it's more appropriated/convenient.

Don't return any value in forwards such as plugin_init, client_connect/disconnect/putinserver, it has no effect.
Just use return with no value if you have to exit the callback before the end of it.

Use mp_c4timer cvar pointer (get_cvar_pointer instead or register_cvar)
__________________
- tired and retired -

Last edited by ConnorMcLeod; 11-09-2011 at 04:56.
ConnorMcLeod is offline
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-09-2011 , 19:03   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #13

Update 0.0.4.
Dark Style is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-10-2011 , 04:08   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #14

You have 3 same lines. I don't see why you duplicate that. Just create a function containing these lines and add a param so you know when sending server_print or client_print.
__________________

Last edited by Arkshine; 11-10-2011 at 04:09.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-10-2011 , 06:30   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #15

Approved.

If you want to make Arkshine happy you can replace :
PHP Code:
    if(!get_pcvar_num(g_on))
    {
        
randomtime random_num(get_pcvar_num(g_mintime), get_pcvar_num(g_maxtime));
        
        
set_pcvar_num(c4timerrandomtime);
        
        
server_print("[AMXX] Random C4 Time [Map]: %i second%s"randomtime, (randomtime 1) ? "s." ".");
        
        return;
    } 
with

PHP Code:
    if(!get_pcvar_num(g_on))
    {
        
event_newround()
        
        
server_print("[AMXX] Random C4 Time [Map]: %i second%s"randomtime, (randomtime 1) ? "s." ".");
        
        return;
    } 
The client_print won't have any effect because no clients are connected at this time.
It is fine as it is though.
__________________
- tired and retired -
ConnorMcLeod is offline
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-10-2011 , 15:09   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #16

Update 0.0.5
Dark Style is offline
Dark Style
BANNED
Join Date: Feb 2011
Location: Brazil
Old 11-19-2011 , 17:37   Re: [CS1.6|CZ] Random C4 Time
Reply With Quote #17

Update 0.0.6
Dark Style is offline
Old 01-17-2012, 05:28
reko_o
This message has been deleted by xPaw. Reason: Flooding "thanks" posts
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:13.


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