Проблемы с connect ip client

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
16
Реакции
0
Ошибка
// C:\amxmodx\scripting\connect_ip_client.sma(110) : warning 233: symbol "geoip_country" is marked as deprecated: Use geoip_country_ex() instead.
//
Компилятор
Локальный
Amx Mod X
1.9.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <geoip>
//#include <colorchat>

#define MAXPLAYER 32
new maxplayers=MAXPLAYER

new id_send;
new temp;
new TeamInfo;
new SayText;

new g_CvarJoinMsg;
new g_CvarJoinCountry;
new g_CvarJoinIp;
new g_CvarJoinAuthId;
new g_CvarJoinSound
new Players[32]
new send_msg[200]

new bool:IsConnected[MAXPLAYER + 1];

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

public plugin_init()
{
register_plugin("Connect IP Client", "1.2", "hunter");
register_dictionary("connect_ip_client.txt")

g_CvarJoinMsg = register_cvar("connect_client_msg", "1")
g_CvarJoinCountry = register_cvar("connect_client_country", "1")
g_CvarJoinIp = register_cvar("connect_client_ip", "1")
g_CvarJoinAuthId = register_cvar("connect_client_authid", "1")
g_CvarJoinSound = register_cvar("connect_client_sound", "1")

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

public plugin_precache()
{
precache_sound(g_szSoundFile);
}
public client_putinserver(player)
{
temp=get_pcvar_num(g_CvarJoinMsg);
IsConnected[player] = true;
if((temp >= 2 && temp<=4) || temp>=6)
{
show_msg(player,"CONNECT_IP_JOINED")
client_cmd(0,"hud_saytext_time 8")
client_cmd(0,"hud_deathnotice_time 8") //lol just my own remove if needed
}
if (temp>=1 && get_pcvar_num(g_CvarJoinSound)) client_cmd(0, "spk %s", g_szSoundFile)
}

public client_disconnected(player)
{
IsConnected[player] = false;
if(get_pcvar_num(g_CvarJoinMsg) >= 4) show_msg(player,"CONNECT_IP_DISCONNECTED");
}
public client_authorized(player)
{
temp=get_pcvar_num(g_CvarJoinMsg);
IsConnected[player] = false;
if(temp == 1 || temp==3 || temp>=5) show_msg(player,"CONNECT_IP_CONNECTING")
}

public show_msg(player,lang_msg[]){
new authid[35],user[32],ip[15],Country[33],msg[200],len;
get_user_name(player,user,31)
get_user_ip(player,ip,15,1)
get_user_authid(player,authid,34)
geoip_country(ip,Country)

len=format(msg,199,"^x04%s^x01",user);
if (get_pcvar_num(g_CvarJoinIp)==1) len+=format(msg[len],199," (^x03%s^x01)",ip);
if (get_pcvar_num(g_CvarJoinAuthId)==1) len+=format(msg[len],199," (^x03%s^x01)",authid);
len+=format(msg[len],199," %s","%L");
if (get_pcvar_num(g_CvarJoinCountry)==1) len+=format(msg[len],199," (^x03%s^x01)",Country);
format(msg[len],199,".");
print_in_chat(msg,lang_msg);
}


public print_in_chat(msg[200],lang_msg[])
{
id_send=get_player()

if (id_send!=-1)
{
new team,id
new team_name[10]
team = get_user_team(id_send);
team_name=get_team_name(team)

format(msg[192],199,"^0")

get_players(Players, maxplayers,"c")
for (new playerIdx=0;playerIdx<maxplayers; ++playerIdx)
{
id = Players[playerIdx];
if (!IsConnected[id]) continue

send_msg=msg;
formatex(send_msg,199,msg,id,lang_msg)

Team_Info(id,id_send,MSG_ONE,"TERRORIST");

message_begin(MSG_ONE, SayText,{0,0,0},id);
write_byte(id_send);
write_string(send_msg);
message_end();

Team_Info(id,id_send,MSG_ONE,team_name);
}
return 1;
}
return 0;
}

Team_Info(id_send,id_change,type,team[])
{
message_begin(type, TeamInfo,_,id_send);
write_byte(id_change);
write_string(team);
message_end();

return 1;
}

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

return -1;
}

get_team_name(team)
{
new team_name[10]
switch(team)
{
case 0:
{
team_name=""
}
case 1:
{
team_name="TERRORIST"
}
case 2:
{
team_name="CT"
}
case 3:
{
team_name="SPECTATOR"
}
}
return team_name
}
Подскажите, как исправить? Не получается скомпилировать под Amx Mod X 1.9.0.
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
1,340
Реакции
529
Помог
91 раз(а)
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Devegame, заменить в коде geoip_country на geoip_country_ex, там же написано.
 
Сообщения
271
Реакции
348
Помог
15 раз(а)
Devegame,
Код:
-geoip_country(ip,Country)
+geoip_country_ex(ip, Country, charsmax(Country));
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу