Raised This Month: $ Target: $400
 0% 

Color?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 12-07-2006 , 11:54   Color?
Reply With Quote #1

how to you make text go in a color "red blue green normal"(cs)?

I want the IP and Country to show up as green

Code:
/* AMXX Mod script.
*
*
*  Join_IP 1.1 created by jsauce
* 
*
*  Okay so this plugin gets a user's info when they are authorized, then
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 
*  
*
*  
*
*  1.1 Changed access() to get_user_flags() seems to work better for everyone.
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A
*  1.0 initial release		// rank idea from Kindzhon's enter/leave plugin.
*
*/


#include <amxmodx>
#include <amxmisc>
#include <geoip>

#define CSSTATS // If you want to show the user's rank on join and on leave.
//	You must be using the csstats module and have stats plugins loaded.
//	Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_ALL	// Change to something else if you like.

public plugin_init()
{
  register_plugin("Join IP","1.1","jsauce")
  
}
public client_authorized(id)
{
	set_task(0.2,"client_is_auth",id)
}

public client_is_auth(id)
{
	new authid[35],user[32],ip[32],players[32],inum,Country[33],Ip[16]
	get_user_name(id,user,31)
	get_user_ip(id,ip,31,1)
	get_user_authid(id,authid,34)
	get_players(players,inum)
	geoip_country(ip,Country)
	#if defined CSSTATS
	new izStats[8], izBody[8]
	new iRankPos, iRankMax
  	iRankPos = get_user_stats(id,izStats,izBody)
  	iRankMax = get_statsnum()
	for (new i = 0; i < inum; ++i)
	{
      	client_print(players[i],print_chat,"%s (%s) (%s) is connecting to server (%s).",user,ip,authid,Country)
	}
	#endif
	return PLUGIN_CONTINUE
}

public client_putinserver(id){
	new authid[35],user[32],ip[32],players[32],inum,Country[33],Ip[16]
	get_user_name(id,user,31)
	get_user_ip(id,ip,31,1)
	get_user_authid(id,authid,34)
	get_players(players,inum)
	geoip_country(ip,Country)
	#if defined CSSTATS
	new izStats[8], izBody[8]
	new iRankPos, iRankMax
  	iRankPos = get_user_stats(id,izStats,izBody)
  	iRankMax = get_statsnum()
	for (new i = 0; i < inum; ++i)
	{
      	client_print(players[i],print_chat,"%s (%s) (%s) Joined (%s).",user,ip,authid,Country)
	client_cmd(players[i],"hud_saytext_time 10")
	client_cmd(players[i],"hud_deathnotice_time 10")
	}
	#endif
	return PLUGIN_CONTINUE
}


public client_disconnect(id)
{
	new authid[35],user[32],ip[32],players[32],inum,Country[33],Ip[16]
	get_user_name(id,user,31)
	get_user_ip(id,ip,31,1)
	get_user_authid(id,authid,34)
	get_players(players,inum)
	geoip_country(ip,Country)
	#if defined CSSTATS
	new izStats[8], izBody[8]
	new iRankPos, iRankMax
  	iRankPos = get_user_stats(id,izStats,izBody)
  	iRankMax = get_statsnum()
	for (new i = 0; i < inum; ++i)
	{

      	client_print(players[i],print_chat,"%s (%s) (%s) has disconnected (%s).",user,ip,authid,Country)

  	}
	#endif
	return PLUGIN_CONTINUE
}
The above works but there is not color so its boring,
thank you
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 12-07-2006 , 12:00   Re: Color?
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=45753
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Old 12-07-2006, 12:03
VEN
This message has been deleted by VEN. Reason: i'm late
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 12-07-2006 , 21:16   Re: Color?
Reply With Quote #3

wow i do not get that
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
blade12
BANNED
Join Date: Oct 2006
Old 12-09-2006 , 12:40   Re: Color?
Reply With Quote #4

Made with color
PHP Code:
/* AMXX Mod script.
*
*
*  Join_IP 1.1 created by jsauce

*
*  Okay so this plugin gets a user's info when they are authorized, then
*  it displays it to everyone when they join and leave. If you are an admin you 
*  get to see the user's ip address and steamid. All other user's just get to see 
*  the player's name! 
*  
*
*  
*
*  1.1 Changed access() to get_user_flags() seems to work better for everyone.
*      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A
*  1.0 initial release        // rank idea from Kindzhon's enter/leave plugin.
*
* thx to jsause for the plugin
*/


#include <amxmodx>
#include <amxmisc>
#include <geoip>

#define CSSTATS // If you want to show the user's rank on join and on leave.
//    You must be using the csstats module and have stats plugins loaded.
//    Comment it out if you don't want to use it.
#if defined CSSTATS
#include <csstats>
#endif
#define ADMIN ADMIN_ALL    // Change to something else if you like.
#define MAXPLAYER 32

enum Color
{
    
YELLOW 1// Yellow
    
GREEN// Green Color
    
TEAM_COLOR// Red, grey, blue
    
GREY// grey
    
RED// Red
    
BLUE// Blue
}

new 
TeamInfo;
new 
SayText;
new 
MaxSlots;

new 
TERRORIST[] = "TERRORIST";
new 
CT[] = "CT";
new 
NOTHING[] = "";
new 
SPEC[] = "SPECTATOR";

new 
bool:IsConnected[MAXPLAYER 1];

public 
plugin_init()
{
  
register_plugin("Join IP","1.1","Blade12")
  
      
TeamInfo get_user_msgid("TeamInfo");
    
SayText get_user_msgid("SayText");
    
MaxSlots get_maxplayers();
  
}
public 
client_authorized(id)
{
    
set_task(0.2,"client_is_auth",id)
}

public 
client_is_auth(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum,Country[33],Ip[16]
    
get_user_name(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
geoip_country(ip,Country)
    
#if defined CSSTATS
         
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
      iRankPos 
get_user_stats(id,izStats,izBody)
      
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
          
client_print(players[i],print_chat,"%s (%s) (%s) is connecting to server (%s).",user,ip,authid,Country)
    }
    
#endif
    
return PLUGIN_CONTINUE
}

public 
client_putinserver(id){
    new 
authid[35],user[32],ip[32],players[32],inum,Country[33],Ip[16]
    
get_user_name(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
geoip_country(ip,Country)
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
      iRankPos 
get_user_stats(id,izStats,izBody)
      
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {
          
client_print(players[i],print_chat,"%s (%s) (%s) Joined (%s).",user,ip,authid,Country)
    
client_cmd(players[i],"hud_saytext_time 10")
    
client_cmd(players[i],"hud_deathnotice_time 10")
    }
    
#endif
    
return PLUGIN_CONTINUE
}
public 
ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
    static 
message[256];

    switch(
type)
    {
        case 
YELLOW// Yellow
        
{
            
message[0] = 0x01;
        }
        case 
GREEN// Green
        
{
            
message[0] = 0x04;
        }
        default: 
// White, Red, Blue
        
{
            
message[0] = 0x03;
        }
    }

    
vformat(message[1], 251msg4);

    
// Make sure message is not longer than 192 character. Will crash the server.
    
message[192] = '^0';

    new 
teamdid;

    if(
id && IsConnected[id])
    {
        
team get_user_team(id);

        
did color_selection(idtype);
        
show_message(ididMSG_ONEmessage);

        if(
did)
        {
            
TeamSelection(idteam);
        }
    } else {
        new 
index FindPlayer();

        if(
index != -1)
        {
            
team get_user_team(index);

            
did color_selection(indextype);
            
show_message(index0MSG_ALLmessage);

            if(
did)
            {
                
TeamSelection(indexteam);
            }
        }
    }
}

show_message(idindextypemessage[])
{
    
message_begin(typeSayText, {000}, index);
    
write_byte(id);
    
write_string(message);
    
message_end();
}

Team_Info(idteam[])
{
    
message_begin(MSG_ALLTeamInfo);
    
write_byte(id);
    
write_string(team);
    
message_end();

    return 
1;
}

color_selection(indexColor:Type)
{
    switch(
Type)
    {
        case 
RED:
        {
            return 
Team_Info(indexTERRORIST);
        }
        case 
BLUE:
        {
            return 
Team_Info(indexCT);
        }
        case 
GREY:
        {
            return 
Team_Info(indexNOTHING);
        }
    }

    return 
0;
}

TeamSelection(indexteam)
{
    switch(
team)
    {
        case 
0:
        {
            
Team_Info(indexNOTHING);
        }
        case 
1:
        {
            
Team_Info(indexTERRORIST);
        }
        case 
2:
        {
            
Team_Info(indexCT);
        }
        case 
3:
        {
            
Team_Info(indexSPEC);
        }
    }
}

FindPlayer()
{
    new 
= -1;

    while(
<= MaxSlots)
    {
        if(
IsConnected[++i])
        {
            return 
i;
        }
    }

    return -
1;
}

public 
client_disconnect(id)
{
    new 
authid[35],user[32],ip[32],players[32],inum,Country[33],Ip[16]
    
get_user_name(id,user,31)
    
get_user_ip(id,ip,31,1)
    
get_user_authid(id,authid,34)
    
get_players(players,inum)
    
geoip_country(ip,Country)
    
#if defined CSSTATS
    
new izStats[8], izBody[8]
    new 
iRankPosiRankMax
      iRankPos 
get_user_stats(id,izStats,izBody)
      
iRankMax get_statsnum()
    for (new 
0inum; ++i)
    {

          
client_print(players[i],print_chat,"%s (%s) (%s) has disconnected (%s).",user,ip,authid,Country)

      }
    
#endif
    
return PLUGIN_CONTINUE

if u dont like it its tuff luck
Attached Files
File Type: sma Get Plugin or Get Source (amx_conip.sma - 670 views - 5.2 KB)
blade12 is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-09-2006 , 13:36   Re: Color?
Reply With Quote #5

Quote:
Originally Posted by blade12 View Post
if u dont like it its tuff luck
lol...
[ --<-@ ] Black Rose is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 12-10-2006 , 02:28   Re: Color?
Reply With Quote #6

its not in color, its still yellow
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-10-2006 , 05:29   Re: Color?
Reply With Quote #7

Something like this?
Code:
/* AMXX Mod script. * * *  Join_IP 1.1 created by jsauce * * *  Okay so this plugin gets a user's info when they are authorized, then *  it displays it to everyone when they join and leave. If you are an admin you *  get to see the user's ip address and steamid. All other user's just get to see *  the player's name! *   * *   * *  1.1 Changed access() to get_user_flags() seems to work better for everyone. *      Also changed how the rank shows, and changed default show level to ADMIN_LEVEL_A *  1.0 initial release      // rank idea from Kindzhon's enter/leave plugin. * */ #include <amxmodx> #include <geoip> //#define CSSTATS // If you want to show the user's rank on join and on leave. //  You must be using the csstats module and have stats plugins loaded. //  Comment it out if you don't want to use it. #if defined CSSTATS #include <csstats> #endif #define ADMIN ADMIN_ALL // Change to something else if you like. public plugin_init()     register_plugin("Join IP","1.1","jsauce")     public client_authorized(id) {         new authid[21],user[32],ip[16],players[32],inum,Country[46], bool:show_rank, iRankPos, strRankPos[7]         get_user_name(id,user,31)     get_user_ip(id,ip,15,1)     get_user_authid(id,authid,20)     get_players(players,inum, "c")     geoip_country(ip,Country, 45)         #if defined CSSTATS     new izStats[8], izBody[8]     iRankPos = get_user_stats(id,izStats,izBody)     show_rank = true     num_to_str(iRankPos, strRankPos, 6)     #endif         for (new i = 0; i < inum; ++i)         client_print(players[i],print_chat,"%s%s%s (^x04%s^x01) (%s) is connecting to server (^x04%s^x01).", show_rank? "#" : "", show_rank? strRankPos : "", user,ip,authid,Country) } public client_putinserver(id) {         new authid[21],user[32],ip[16],players[32],inum,Country[46], bool:show_rank, iRankPos, strRankPos[7]         get_user_name(id,user,31)     get_user_ip(id,ip,15,1)     get_user_authid(id,authid,20)     get_players(players,inum, "c")     geoip_country(ip,Country, 45)         #if defined CSSTATS     new izStats[8], izBody[8]     iRankPos = get_user_stats(id,izStats,izBody)     show_rank = true     num_to_str(iRankPos, strRankPos, 6)     #endif         for (new i = 0; i < inum; ++i) {         client_print(players[i],print_chat,"%s%s%s (^x04%s^x01) (%s) Joined (^x04%s^x01).", show_rank? "#" : "", show_rank? strRankPos : "",user,ip,authid,Country)         client_cmd(players[i],"hud_saytext_time 10")         client_cmd(players[i],"hud_deathnotice_time 10")     } } public client_disconnect(id) {         new authid[21],user[32],ip[16],players[32],inum,Country[46], bool:show_rank, iRankPos, strRankPos[7]         get_user_name(id,user,31)     get_user_ip(id,ip,15,1)     get_user_authid(id,authid,20)     get_players(players,inum, "c")     geoip_country(ip,Country, 45)         #if defined CSSTATS     new izStats[8], izBody[8]     iRankPos = get_user_stats(id,izStats,izBody)     show_rank = true     num_to_str(iRankPos, strRankPos, 6)     #endif         for (new i = 0; i < inum; ++i)         client_print(players[i],print_chat,"%s%s%s (^x04%s^x01) (%s) has disconnected (^x04%s^x01).", show_rank? "#" : "", show_rank? strRankPos : "",user,ip,authid,Country) }
[ --<-@ ] Black Rose is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-02-2007 , 19:56   Re: Color?
Reply With Quote #8

all that did was put spaces in there, just by useing client print print chat with ^x04 doesnt work
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-02-2007 , 20:22   Re: Color?
Reply With Quote #9

ok im slowly getting it, +karmak
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 01-02-2007 , 21:17   Re: Color?
Reply With Quote #10

http://forums.alliedmods.net/showthread.php?p=422969

dam its bit bulky
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow 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 23:26.


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