Raised This Month: $51 Target: $400
 12% 

[req] plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
UaExFanTasY
Senior Member
Join Date: Mar 2013
Location: UAE
Old 06-05-2016 , 23:03   [req] plugin
Reply With Quote #1

hello community

i'm asking if anyone would be able to make this plugin

similar to GHW Connect Messages

but


i want it to be

[AMXX] Name has connected (City) (country).
[AMXX] Name disconnect (City) (country).


instead of


[AMXX] Name (STEAMID) has connected (country).
[AMXX] Name (STEAMID) disconnect (country).
__________________
__________________
UaExFanTasY is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-06-2016 , 05:35   Re: [req] plugin
Reply With Quote #2

PHP Code:
register_cvar("cm_connect_string","[AMXX] %name (%steamid) has connected (%country).")
register_cvar("cm_disconnect_string","[AMXX] %name (%steamid) has disconnected (%country)."
You have these cvars, i think you can change them...

You should put this into your amxx.cfg:
Code:
amx_cvar cm_connect_string "[AMXx] %name has connected (%country)."
amx_cvar cm_disconnect_string "[AMXx] %name disconnected (%country)."

Unfortunately, city is impossible afaik...
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 06-06-2016 , 05:46   Re: [req] plugin
Reply With Quote #3

Why do you tell people it is impossible without getting informed?

Install the latest geoip on your server : https://forums.alliedmods.net/showthread.php?t=95665

And wait for the plugin.

The Plugin :

PHP Code:
#include <amxmodx>

#if defined geoip_included
    #endinput
#endif
#define _geoip_included

#if AMXX_VERSION_NUM >= 175
    #pragma reqlib geoip
    #if !defined AMXMODX_NOAUTOLOAD
        #pragma loadlib geoip
    #endif
#else
    #pragma library geoip
#endif

native geoip_country_ex(const ip[], result[], lenid = -1);

native geoip_city(const ip[], result[], lenid = -1);

#define MAXPLAYER 32

new id_send;
new 
TeamInfo;
new 
SayText;

new 
bool:IsConnected[MAXPLAYER 1];

new 
g_szSoundFile[] = "buttons/blip1.wav";

public 
plugin_init()
{
    
register_plugin("IP Join Info""1.1""idk");

    
TeamInfo get_user_msgid("TeamInfo");
    
SayText get_user_msgid("SayText");
}

public 
plugin_precache()
{
    
precache_sound(g_szSoundFile);
}

public 
client_putinserver(player)
{
    
IsConnected[player] = true;
    
    
show_msg(playertrue)    
    
client_cmd(0"spk %s"g_szSoundFile)
}

public 
client_disconnect(player)
{
    
IsConnected[player] = false;
    
show_msg(playerfalse)    
}
public 
client_authorized(player)
{
    
IsConnected[player] = false;
}

public 
show_msg(playerconnect){
    new 
user[32],ip[16],Country[33],City[33],msg[200],len;
    
get_user_ip(playerip 151)
    
get_user_name(player,user,31)
    
geoip_country_ex(ip,Country32)
    
geoip_city(ipCity32);
    
    
len=format(msg,199,"^x04%s ^x01",user);
    
len+=format(msg[len],199," %s"connect "has connected" "disconnect");
    if(
strlen(Country) && strlen(City))
     
len+=format(msg[len],199," (^x03%s^x01, ^x03%s^x01)",CountryCity);
    else
     if(
strlen(Country) || strlen(City))
        
len+=format(msg[len],199," (^x03%s%s^x01)",CountryCity);
    
print_in_chat(0msg);
}

public 
print_in_chat(id, const msg[])
{
    if(
id && IsConnected[id]) id_send=id
    
else id_send=get_player()
    
    if (
id_send!=-1)
    {
        new 
team;
        
team get_user_team(id_send);
        
        static 
message[256];
        
vformat(message255msg3);
        
message[192] = '^0';        
        
        
Team_Info(id_send,"TERRORIST");        
        
        
message_begin(MSG_ALLSayText, {000}, id);
        
write_byte(id_send);
        
write_string(message);
        
message_end();
        
        
TeamSelection(id_sendteam);        
    }
    return 
1;
}

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

    return 
1;
}


TeamSelection(indexteam)
{
    switch(
team)
    {
        case 
0:
        {
            
Team_Info(index"");
        }
        case 
1:
        {
            
Team_Info(index"TERRORIST");
        }
        case 
2:
        {
            
Team_Info(index"CT");
        }
        case 
3:
        {
            
Team_Info(index"SPECTATOR");
        }
    }
}

get_player()
{
    for( new 
plr 1plr <= MAXPLAYERplr++ )
    {
        if( 
IsConnected[plr] )
        {
            return 
plr;
        }
    }
    
    return -
1;


Last edited by siriusmd99; 06-06-2016 at 07:38.
siriusmd99 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 11:07.


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