Gena2017
Участник
- Сообщения
- 5
- Реакции
- 0
Привет.Уважаемы Гуру. Помогите добавить в этот код.
Чтоб показывало еще из какого города.
Этот код
Оригинал
От сюда ... Другого не нашел
Оригинал
Спасибо.. Просто хотелось что и город показывало.
Чтоб показывало еще из какого города.
Этот код
C-подобный:
public RankConnectCallback(client, rank, any:data){
if (!g_bRankBots && (!IsValidClient(client) || IsFakeClient(client)))
return;
g_aPointsOnConnect[client] = RankMe_GetPoints(client);
g_aRankOnConnect[client] = rank;
new String:sClientName[MAX_NAME_LENGTH];
GetClientName(client,sClientName,sizeof(sClientName));
/* Geoip, code from cksurf */
decl String:s_Country[32];
decl String:s_address[32];
GetClientIP(client, s_address, 32);
Format(s_Country, 100, "Unknown");
GeoipCountry(s_address, s_Country, 100);
if(!strcmp(s_Country, NULL_STRING))
Format( s_Country, 100, "Unknown", s_Country );
else
if( StrContains( s_Country, "United", false ) != -1 ||
StrContains( s_Country, "Republic", false ) != -1 ||
StrContains( s_Country, "Federation", false ) != -1 ||
StrContains( s_Country, "Island", false ) != -1 ||
StrContains( s_Country, "Netherlands", false ) != -1 ||
StrContains( s_Country, "Isle", false ) != -1 ||
StrContains( s_Country, "Bahamas", false ) != -1 ||
StrContains( s_Country, "Maldives", false ) != -1 ||
StrContains( s_Country, "Philippines", false ) != -1 ||
StrContains( s_Country, "Vatican", false ) != -1 )
{
Format( s_Country, 100, "The %s", s_Country );
}
if(g_bAnnounceConnect){
if(g_bAnnounceConnectChat){
CPrintToChatAll("%s %t",MSG,"PlayerJoinedChat",sClientName,g_aRankOnConnect[client],g_aPointsOnConnect[client],s_Country);
}
if(g_bAnnounceConnectHint){
PrintHintTextToAll("%t","PlayerJoinedHint",sClientName,g_aRankOnConnect[client],g_aPointsOnConnect[client],s_Country);
}
}
if(g_bAnnounceTopConnect && rank <= g_AnnounceTopPosConnect){
if(g_bAnnounceTopConnectChat){
CPrintToChatAll("%s %t",MSG,"TopPlayerJoinedChat",g_AnnounceTopPosConnect,sClientName,g_aRankOnConnect[client],s_Country);
}
if(g_bAnnounceTopConnectHint){
PrintHintTextToAll("%t","TopPlayerJoinedHint",g_AnnounceTopPosConnect,sClientName,g_aRankOnConnect[client],s_Country);
}
}
}
Оригинал
От сюда ... Другого не нашел
C-подобный:
public OnClientConnected( client )
{
new String:IP[16];
new String:City[32];
GetClientIP( client, IP, 16 );
GeoipCity( IP, City, 32 );
PrintToChat( client, "%N is from %s", client, City );
}
Оригинал
Спасибо.. Просто хотелось что и город показывало.