Raised This Month: $ Target: $400
 0% 

Connect Message?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Neal121
Member
Join Date: Feb 2007
Old 03-26-2007 , 23:17   Connect Message?
Reply With Quote #1

Alright I know theres a ton of connecting messages however I want one that will NOT display whether or not the player is an admin or just a player.

I want one that just says like...

*name* is connecting. (Country)

NOT

Admin *name* is connecting. (Country)

I want to keep my admins at least semi-secret so they can catch people messing around.
Neal121 is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 03-27-2007 , 01:36   Re: Connect Message?
Reply With Quote #2

Try this:
Code:

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

#define PLUGIN "Country Connector"
#define VERSION "1.0"
#define AUTHOR "Styles"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_connect(id)
{
	new usrip[33], result[46], username[33];
	get_user_ip(id, usrip, 32, 1); 
	geoip_country(usrip, result, 45);
	
	get_user_name(id, username, 32);
	
	set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0)
	
	if(is_user_admin(id))
		show_hudmessage(id, "ADMIN: %s is connecting. (%s)", username, result)
	else		
		show_hudmessage(id, "%s is connecting. (%s)", username, result)
	
}
Styles is offline
Send a message via AIM to Styles
Neal121
Member
Join Date: Feb 2007
Old 03-27-2007 , 10:19   Re: Connect Message?
Reply With Quote #3

Quick Change Please...

*Name* (Steam ID) is connecting. (Country)

then

*Name* (Steam ID) has connected. (Country)

So example.

Neal (SteamId 1:1123213) is connecting. (United States)
Neal (SteamId 1:1123213) has connected. (United States

I want this to show all players the same, even admins. I dont want my admins to be noticed they are admins. So NO Admin Neal (SteamID) is connecting.
Neal121 is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 03-27-2007 , 10:53   Re: Connect Message?
Reply With Quote #4

Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>

#define PLUGIN "Country Connector"
#define VERSION "1.0"
#define AUTHOR "Styles"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_connect(id)
{
	new usrip[33], result[46], username[33], steamid[38];
	get_user_ip(id, usrip, 32, 1); 
	geoip_country(usrip, result, 45);
	
	get_user_name(id, username, 32);
	get_user_authid(id, steamid, 37);
	
	set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0);		
	show_hudmessage(0, "%s (%s) is connecting. (%s)", username, steamid, result);
	
}

public client_putinserver(id)
{
	new usrip[33], result[46], username[33], steamid[38];
	get_user_ip(id, usrip, 32, 1); 
	geoip_country(usrip, result, 45);
	
	get_user_name(id, username, 32);
	get_user_authid(id, steamid, 37);
	
	set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0);		
	show_hudmessage(0, "%s (%s) has connected. (%s)", username, steamid, result);	
}
Deviance is offline
Neal121
Member
Join Date: Feb 2007
Old 03-27-2007 , 11:07   Re: Connect Message?
Reply With Quote #5

I havent tried it yet but I forgot to add something I wanted. (hate me that I keep wanting more to it but... sorry.)

Since I havent tried it, is it a tsay message or just your basic chat area message. I want it in the chat area as your basic text. Also want it a different color than white (or whatever is the default color). Perhaps green? or yellow? or red? Maybe different for playername?

To verify: (black is default text color)

player1: lol!
player2: dude!
Neal (STEAM_0:1:1111111) is connecting. (United States)
player1: hmm
Neal (STEAM_0:1:1111111) is now playing. (United States)
player2: sup neal!

And perhaps a disconnect message?

Example:
Neal (STEAM_0:1:1111111) has disconnected from the server. (United States)

Thanks for all the help guys!
Neal121 is offline
Neal121
Member
Join Date: Feb 2007
Old 03-27-2007 , 16:32   Re: Connect Message?
Reply With Quote #6

Anyone?!?

I understand its a little more demanding than what I originally asked.
Neal121 is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 03-27-2007 , 17:37   Re: Connect Message?
Reply With Quote #7

yeah.. but I would have done it but I finished the original in like 5mins.. I got a few mins online. I am grounded so I can't do ahit sry.. posting via cellphone.
Styles is offline
Send a message via AIM to Styles
Neal121
Member
Join Date: Feb 2007
Old 03-28-2007 , 11:34   Re: Connect Message?
Reply With Quote #8

Alright well, if anyone else can help out... be awesome! lol
Neal121 is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 03-28-2007 , 15:09   Re: Connect Message?
Reply With Quote #9

Here you are:

Code:
#include <amxmodx> #include <amxmisc> #include <geoip> #define MAXSLOTS 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 bool:IsConnected[MAXSLOTS + 1]; new TeamName[][] = {     "",     "TERRORIST",     "CT",     "SPECTATOR" } new PluginEnable; public plugin_init() {     register_plugin("Connect Message", "1.03", "MaTTe");         PluginEnable = register_cvar("connect_enable", "1");         TeamInfo = get_user_msgid("TeamInfo");     SayText = get_user_msgid("SayText");     MaxSlots = get_maxplayers(); } public client_connect(id) {     if(get_pcvar_num(PluginEnable)) {         new result[51];         new name[32];         get_user_name(id, name, 31);         new steamid[32];         get_user_authid(id, steamid, 31);         new ip[32];         get_user_ip(id, ip, 31, 1);         geoip_country(ip, result, 50);         ColorChat(id, RED, "%s ^x04(%s) ^x01is connecting ^x04(%s)", name, steamid, result);     } }     public client_putinserver(player) {     if(get_pcvar_num(PluginEnable)) {         new result[51];         new name[32];         get_user_name(player, name, 31);         new steamid[32];         get_user_authid(player, steamid, 31);         new ip[32];         get_user_ip(player, ip, 31, 1);         geoip_country(ip, result, 50);         ColorChat(player, RED, "%s ^x04(%s) ^x01has connected ^x04(%s)", name, steamid, result);         IsConnected[player] = true;     } } public client_disconnect(player) {     if(get_pcvar_num(PluginEnable)) {         new result[51];         new name[32];         get_user_name(player, name, 31);         new steamid[32];         get_user_authid(player, steamid, 31);         new ip[32];         get_user_ip(player, ip, 31, 1);         geoip_country(ip, result, 50);         ColorChat(0, RED, "%s ^x04(%s) ^x01has disconnected ^x04(%s)", name, steamid, result);         IsConnected[player] = false;     } }           public ColorChat(id, Color: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], 251, msg, 4);     // Make sure message is not longer than 192 character. Will crash the server.     message[192] = '^0';     new team, ColorChange, index, MSG_Type;         if(!id)     {         index = FindPlayer();         MSG_Type = MSG_ALL;         } else {         MSG_Type = MSG_ONE;         index = id;     }         team = get_user_team(index);        ColorChange = ColorSelection(index, MSG_Type, type);     ShowColorMessage(index, MSG_Type, message);             if(ColorChange)     {         Team_Info(index, MSG_Type, TeamName[team]);     } } ShowColorMessage(id, type, message[]) {     emessage_begin(type, SayText, _, id);     ewrite_byte(id)         ewrite_string(message);     emessage_end(); } Team_Info(id, type, team[]) {     emessage_begin(type, TeamInfo, _, id);     ewrite_byte(id);     ewrite_string(team);     emessage_end();     return 1; } ColorSelection(index, type, Color:Type) {     switch(Type)     {         case RED:         {             return Team_Info(index, type, TeamName[1]);         }         case BLUE:         {             return Team_Info(index, type, TeamName[2]);         }         case GREY:         {             return Team_Info(index, type, TeamName[0]);         }     }     return 0; } FindPlayer() {     new i = -1;     while(i <= MaxSlots)     {         if(IsConnected[++i])         {             return i;         }     }     return -1; }
mateo10 is offline
Neal121
Member
Join Date: Feb 2007
Old 03-28-2007 , 16:51   Re: Connect Message?
Reply With Quote #10

Thank YoU!
Neal121 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 10:35.


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