Raised This Month: $ Target: $400
 0% 

message doesn't shows when player connects


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Afro-Ankan
Member
Join Date: Jul 2009
Location: Sweden
Old 07-13-2010 , 09:32   message doesn't shows when player connects
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <geoip>
#define MAX_SAVE_CONNECTS 10000
new g_iConnectSaves;
new 
g_sAuthid[MAX_SAVE_CONNECTS][35];
new 
g_iConnections[MAX_SAVE_CONNECTS];
new 
g_iMsgSayText;
new 
g_iMaxPlayers;
public 
plugin_init()
{
 
register_plugin("Connect""1.0""someone");
 
g_iMsgSayText get_user_msgid("SayText");
 
g_iMaxPlayers get_maxplayers();
}
public 
client_putinserver(id)
{
 static 
sAuthid[sizeof(g_sAuthid[])], iNum;
 
get_user_authid(idsAuthidsizeof(sAuthid) - 1);
 
iNum = -1
 
if(g_iConnectSaves 0)
 {
  static 
i;
  for(
0g_iConnectSavesi++)
  {
   if(
equali(g_sAuthid[i], sAuthid))
   {
    
iNum i;
    
g_iConnections[i]++;
    break;
   }
  }
 }
 if(
iNum == -&& g_iConnectSaves MAX_SAVE_CONNECTS)
 {
  
copy(g_sAuthid[g_iConnectSaves], sizeof(g_sAuthid[]) - 1sAuthid);
  
iNum g_iConnectSaves++;
 }
 
 static 
sName[32], sIP[64], sCountry[46];
 
get_user_name(idsNamesizeof(sName) - 1);
 
get_user_ip(idsIPsizeof(sIP) - 11);
 
geoip_country(sIPsCountrysizeof(sCountry) - 1);
 
 static 
sMessage[192];
 
formatex(sMessagesizeof(sMessage) - 1"^x04[Connect] %s connected from %s [Connections: %d]"sNamesCountryg_iConnections[iNum]);
 
green_print(0sMessage);
}
public 
client_disconnect(id)
{
 static 
sName[32], sIP[64], sCountry[46];
 
get_user_name(idsNamesizeof(sName) - 1);
 
get_user_ip(idsIPsizeof(sIP) - 11);
 
geoip_country(sIPsCountrysizeof(sCountry) - 1);
 
 static 
sMessage[192];
 
formatex(sMessagesizeof(sMessage) - 1"^x04[Connect] %s disconnected from %s."sNamesCountry);
 
green_print(0sMessage);
}
stock green_print(indexsMessage[])
{
 if(
get_playersnum() < 1)
 {
  return 
0;
 }
 
 static 
MSG_typeid;
 if(
is_user_connected(index))
 {
  
id index;
  
MSG_type MSG_ONE_UNRELIABLE;
 }
 else
 {
  static 
i;
  for(
1<= g_iMaxPlayersi++)
  {
   if(
is_user_connected(i))
   {
    
id i;
    break;
   }
  }
  
MSG_type MSG_BROADCAST;
 }
 
 
message_begin(MSG_typeg_iMsgSayText_id);
 
write_byte(id);
 
write_string(sMessage);
 
message_end();
 
 return 
1;


Last edited by Afro-Ankan; 07-13-2010 at 09:40.
Afro-Ankan is offline
Send a message via MSN to Afro-Ankan
 



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 07:06.


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