Raised This Month: $ Target: $400
 0% 

[HELP] With Connect Announce


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
viniref
Junior Member
Join Date: Apr 2011
Old 05-14-2011 , 15:35   [HELP] With Connect Announce
Reply With Quote #1

I'm using the plugin connect announce the v3x. I would add the option to see the country in the phrase that appears when someone connects.

The SMA is as follows, would be grateful if someone did for me.
Attached Files
File Type: sma Get Plugin or Get Source (connect_announce.sma - 612 views - 3.3 KB)
viniref is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-14-2011 , 20:59   Re: [HELP] With Connect Announce
Reply With Quote #2

geoip_country - Gets a full country name.
Syntax:

geoip_country ( ip[], result[], [ len = 45 ] )
jimaway is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 05-17-2011 , 02:50   Re: [HELP] With Connect Announce
Reply With Quote #3

I'm using this:
PHP Code:
#define PLUGIN     "Connect Informer"
#define AUTHOR     "Leon McVeran"
#define VERSION     "v1.0"
#define PDATE     "6th September 2010"

#include <amxmodx>
#include <geoip>

#define ACCESS_LEVEL     ADMIN_KICK

new g_iMaxPlayers
new g_szCountry[33][32]
new 
g_szPrefix[] = "[AMXX]" // or your clan name ;)

new gMsgSayText
new gMsgTeamInfo

public plugin_init(){
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_cfg(){
    
gMsgSayText get_user_msgid("SayText")
    
gMsgTeamInfo get_user_msgid("TeamInfo")

    
g_iMaxPlayers get_maxplayers()
}

public 
client_putinserver(id){
    new 
szIP[20]
    
get_user_ip(idszIP19)
    
geoip_country(szIPg_szCountry[id], 31)

    new 
szName[32]
    
get_user_name(idszName31)

    new 
szMsg[192]
    if (
is_user_bot(id)){
        
formatex(szMsg191"^x03%s^x04 Bot:^x01 %s has connected"g_szPrefixszName)
    }

    
// Wenn kein Land ermittelt werden konnte
    
else if (equal(g_szCountry[id], "error")){
        
formatex(szMsg191"^x03%s^x04 %s:^x01 %s has connected"g_szPrefixget_user_flags(id) & ACCESS_LEVEL "Admin" "Player"szName)
    }
    else{
        
formatex(szMsg191"^x03%s^x04 %s:^x01 %s has connected from^x03 %s"g_szPrefixget_user_flags(id) & ACCESS_LEVEL "Admin" "Player"szNameg_szCountry[id])
    }

    for (new 
iPlayer 1iPlayer <= g_iMaxPlayersiPlayer++){
        if (
is_user_connected(iPlayer)){
            
Create_ChatMsg(iPlayerszMsg)
        }
    }
}

public 
client_disconnect(id){
    new 
szName[32]
    
get_user_name(idszName31)

    new 
szMsg[192]
    if (
is_user_bot(id)){
        
formatex(szMsg191"^x03%s^x04 Bot:^x01 %s has left the server"g_szPrefixszName)
    }

    
// Wenn kein Land ermittelt werden konnte
    
else if (equal(g_szCountry[id], "error")){
        
formatex(szMsg191"^x03%s^x04 %s:^x01 %s has left the server"g_szPrefixget_user_flags(id) & ACCESS_LEVEL "Admin" "Player"szName)
    }
    else{
        
formatex(szMsg191"^x03%s^x04 %s:^x01 %s from^x03 %s^x01 has left the server"g_szPrefixget_user_flags(id) & ACCESS_LEVEL "Admin" "Player"szNameg_szCountry[id])
    }

    for (new 
iPlayer 1iPlayer <= g_iMaxPlayersiPlayer++){
        if (
is_user_connected(iPlayer)){
            
Create_ChatMsg(iPlayerszMsg)
        }
    }
}

stock Create_ChatMsg(idszMsg[]){

    
// A user message must be smaller than 192 Bytes, otherwise the server crashs.
    
szMsg[182]='^0'

    
new szTeam[10], szColor[10]
    
get_user_team(idszTeam9)
    
copy(szColor9"TERRORIST")

    
// Change team to create a red colored message
    
message_begin(MSG_ONEgMsgTeamInfo, { 000}, id)
    
write_byte(id)
    
write_string(szColor)
    
message_end()

    
// Print the message
    
message_begin(MSG_ONEgMsgSayText, {000}, id)
    
write_byte(id)
    
write_string(szMsg)
    
message_end()

    
// Change back to the original team
    
message_begin(MSG_ONEgMsgTeamInfo, { 000}, id)
    
write_byte(id)
    
write_string(szTeam)
    
message_end()


__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015
Leon M. 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 04:27.


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