Raised This Month: $ Target: $400
 0% 

print_color only show for team?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-25-2015 , 11:49   Re: print_color only show for team?
Reply With Quote #2

Example (Untested)

PHP Code:
#include <amxmodx>
#include <cstrike>

#define PRINT_TO CS_TEAM_CT

public plugin_init()
{
    
register_plugin("Color Print to specific team""Example""redivcram");
    
    
register_clcmd("/print""CmdPrint");
}

public 
CmdPrint()
{
    new 
players[32], numiid;
    
    
get_players(playersnum"a");
    
    for(
0numi++)
    {
        
id players[i];
        
        if(
cs_get_user_team(id) == PRINT_TO)
        {
            
print_color(idTEAM"^x04[TEST]^x03 Hello to %s"PRINT_TO);
        }
    }
    return 
PLUGIN_HANDLED;
}

stock print_color(indexcolor, const msg[], any:...) 

    new 
szMessage[192
    
szMessage[0] = 0x04 
    vformat
(szMessage[1], charsmax(szMessage)-1msg4
     
    new 
iSayText 
    
if (iSayText || (iSayText get_user_msgid("SayText"))) 
    { 
        
message_begin(index MSG_ONE_UNRELIABLE MSG_BROADCASTiSayText_index
        { 
            
write_byte(color
            
write_string(szMessage)
        } 
        
message_end()
    } 

redivcram is offline
 



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 18:03.


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