SXGEO Plugin Countrykicker Fix Pls |
Здравствуйте, гость Вход | Регистрация
Наши новости:
|
|
SXGEO Plugin Countrykicker Fix Pls |
Infamous2017 |
25.11.2018, 17:56
Сообщение
|
Hello i got an Plugin from Oxi who should kick forbidden Countries but the Plugin dont work.
The Module SXGEO is running, (https://dev-cs.ru/threads/2733/ ) the Plugin is showing running, i am running 1.8.3 plugins and reamxmod 1.8.3 Maybe anyone have an idea why it dont work... I am from Germany so i added "de" and it should kick me but nothing happens... here is the SMA Код #include <amxmodx> #include <sxgeo> new const g_szCountries[][] = { "bg", "de" } new const g_szKickReason[] = "Players from your country are not allowed here." new Trie:g_tCountries public plugin_init() { register_plugin("SxGeo: Country Kicker", "1.0", "OciXCrom") g_tCountries = TrieCreate() for(new i; i < sizeof(g_szCountries); i++) TrieSetCell(g_tCountries, g_szCountries[i], true) } public plugin_end() TrieDestroy(g_tCountries) public client_connect(id) { new szIP[22], szCode[3] get_user_ip(id, szIP, charsmax(szIP)) sxgeo_code(szIP, szCode) log_amx("%s connected from %s", szIP, szCode) if(TrieKeyExists(g_tCountries, szCode)) server_cmd("kick #%i ^"%s^"", get_user_userid(id), g_szKickReason) } |
|
|
|
SISA |
25.11.2018, 22:07
Сообщение
|
Какая строка в вашем коде не работает ?
|
|
|
|
Infamous2017 |
25.11.2018, 22:12
Сообщение
|
This is the question... The Plugin showing as "running" but it do nothing........ So maybe the full code is bugged idk... this why i asked here for help
|
|
|
|
SISA |
25.11.2018, 22:37
Сообщение
|
Какой смысл в получении готового ответа, если он не прибавляет ваших знаний ?
1. sxgeo в сравнении с geoip, обладает низким процентом определения данных. Для нормальной работы нужен geoip 2. Вы получаете IP:PORT из функции get_user_ip, так как не используете последний аргумент 3. При использовании функци TrieKeyExists, de != DE #include <sxgeo> > #include <geoip> get_user_ip(id, szIP, charsmax(szIP)) > get_user_ip(id, szIP, charsmax(szIP), 1) sxgeo_code(szIP, szCode) > geoip_code2_ex(szIP, szCode) { "bg", "de" } > { "BG", "DE" }
Отредактировал: SISA, - 25.11.2018, 22:37
|
|
Поблагодарили 1 раз
|
|
Infamous2017 |
26.11.2018, 19:40
Сообщение
|
THANK YOU. works now.
Код #include <amxmodx> #include <sxgeo> #include <geoip> new const g_szCountries[][] = { "LY" } new const g_szKickReason[] = "Players from your country are not allowed here." new Trie:g_tCountries public plugin_init() { register_plugin("SxGeo: Country Kicker", "1.0", "OciXCrom") g_tCountries = TrieCreate() for(new i; i < sizeof(g_szCountries); i++) TrieSetCell(g_tCountries, g_szCountries[i], true) } public plugin_end() TrieDestroy(g_tCountries) public client_connect(id) { new szIP[22], szCode[3] get_user_ip (id, szIP, charsmax (szIP), 1) geoip_code2_ex(szIP, szCode) log_amx("%s connected from %s", szIP, szCode) if(TrieKeyExists(g_tCountries, szCode)) server_cmd("kick #%i ^"%s^"", get_user_userid(id), g_szKickReason) } |
|
|
|