Raised This Month: $ Target: $400
 0% 

Connect Message?


Post New Thread Reply   
 
Thread Tools Display Modes
Neal121
Member
Join Date: Feb 2007
Old 03-29-2007 , 12:44   Re: Connect Message?
Reply With Quote #21

The colors do not show, comes up as the default text which is not a problem.

However, still not showing the connect messages.
Neal121 is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 03-29-2007 , 13:15   Re: Connect Message?
Reply With Quote #22

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(0, RED, "%s ^x04(%s) ^x01is connecting ^x04(%s)", name, steamid, result);     } }     public client_putinserver(player) {     if(get_pcvar_num(PluginEnable)) {         IsConnected[player] = true;         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 connected ^x04(%s)", name, steamid, result);     } } 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-29-2007 , 16:48   Re: Connect Message?
Reply With Quote #23

I can fix it (or you can) but what do I take out to get the steam id removed from connecting? (Steam ID pending is annoying) Just so it says the name when they connect. (and country of course)
Neal121 is offline
Neal121
Member
Join Date: Feb 2007
Old 03-30-2007 , 09:12   Re: Connect Message?
Reply With Quote #24

Ive been getting a ton of :

L 03/30/2007 - 00:05:44: [AMXX] Displaying debug trace (plugin "connect.amxx")
L 03/30/2007 - 00:05:44: [AMXX] Run time error 4: index out of bounds
L 03/30/2007 - 00:05:44: [AMXX] [0] textRyeTXk.sma::ColorChat (line 150)
L 03/30/2007 - 00:05:44: [AMXX] [1] textRyeTXk.sma::client_connect (line 59)

Fix?
Neal121 is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 03-30-2007 , 13:57   Re: Connect Message?
Reply With Quote #25

For whos plugin? witch one did u use?
Styles is offline
Send a message via AIM to Styles
Neal121
Member
Join Date: Feb 2007
Old 03-30-2007 , 16:56   Re: Connect Message?
Reply With Quote #26

mats
Neal121 is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 03-31-2007 , 09:08   Re: Connect Message?
Reply With Quote #27

I don't really know what's wrong..
mateo10 is offline
Neal121
Member
Join Date: Feb 2007
Old 03-31-2007 , 11:44   Re: Connect Message?
Reply With Quote #28

Perhaps removing the color chat lines may fix it. Should try re-writing it for just the basic text format. No teams as well. May work.

Last edited by Neal121; 03-31-2007 at 11:53.
Neal121 is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 04-01-2007 , 15:25   Re: Connect Message?
Reply With Quote #29

This should work:
Code:
#include <amxmodx> #include <geoip> new PluginEnable; public plugin_init() {     register_plugin("Connect Message", "1.00", "MaTTe");     PluginEnable = register_cvar("connectmsg_enable", "1"); } public client_connect(id) {     if(get_pcvar_num(PluginEnable)) {         new result[52];         new name[32];         get_user_name(id, name, 31);         new ip[32];         get_user_ip(id, ip, 31);         geoip_country(ip, result, 51);         client_print(0, print_chat, "%s (%s) is connecting...", name, result);     } } public client_putinserver(id) {     if(get_pcvar_num(PluginEnable)) {         new result[52];         new name[32];         get_user_name(id, name, 31);         new ip[32];         get_user_ip(id, ip, 31);         geoip_country(ip, result, 51);         client_print(0, print_chat, "%s (%s) has connected.", name, result);     } } public client_disconnect(id) {     if(get_pcvar_num(PluginEnable)) {         new result[52];         new name[32];         get_user_name(id, name, 31);         new ip[32];         get_user_ip(id, ip, 31);         geoip_country(ip, result, 51);         client_print(0, print_chat, "%s (%s) has disconnected.", name, result);     } }
mateo10 is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 04-01-2007 , 17:03   Re: Connect Message?
Reply With Quote #30

Back to the basics mateo10 ?
_Master_ 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 16:16.


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