Raised This Month: $ Target: $400
 0% 

Reduce code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-02-2015 , 08:46   Re: Reduce code
Reply With Quote #1

I would go with this. Additionally, it will work for any number of players, not just up to 6!
PHP Code:
if(get_pcvar_num(CVARenabled) == 1)
{
    
set_dhudmessage(random(256), random(256), random(256));
    new 
iCTCount cs_get_counter_count(1);
    new 
iTCount cs_get_terrorist_count(1);
    
    if(
iCTCount == && iTCount == 1)
        
show_dhudmessage(0"%s Vs %s!"CTnameTname);
    else if(
iCTCount && iTCount == 1)
        
show_hudmessage(0"%s Vs %d Ct!"TnameiCTCount);
    else if(
iTCount && iCTCount == 1)
        
show_hudmessage(0"%s Vs %d T!"TnameiTCount); // Should this be CTname instead of Tname?
    
    
    
client_cmd(read_data(2), "spk %s"g_szSoundVoice);    

EDIT:
Yami ninja'd me... :/

Last edited by klippy; 01-02-2015 at 08:47.
klippy 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 15:17.


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