{"action":"created","issue":{"url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/issues/190","repository_url":"https://api.github.com/repos/Southclaw/ScavengeSurvive","labels_url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/issues/190/comments","events_url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/issues/190/events","html_url":"https://github.com/Southclaw/ScavengeSurvive/issues/190","id":142170370,"number":190,"title":"Country.pwn (iphub.info)","user":{"login":"DarkQuery","id":10682806,"avatar_url":"https://avatars.githubusercontent.com/u/10682806?v=3","gravatar_id":"","url":"https://api.github.com/users/DarkQuery","html_url":"https://github.com/DarkQuery","followers_url":"https://api.github.com/users/DarkQuery/followers","following_url":"https://api.github.com/users/DarkQuery/following{/other_user}","gists_url":"https://api.github.com/users/DarkQuery/gists{/gist_id}","starred_url":"https://api.github.com/users/DarkQuery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarkQuery/subscriptions","organizations_url":"https://api.github.com/users/DarkQuery/orgs","repos_url":"https://api.github.com/users/DarkQuery/repos","events_url":"https://api.github.com/users/DarkQuery/events{/privacy}","received_events_url":"https://api.github.com/users/DarkQuery/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/labels/cannotreproduce","name":"cannotreproduce","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-20T14:45:57Z","updated_at":"2016-03-21T14:44:30Z","closed_at":"2016-03-21T13:22:18Z","body":"Hi, I have a slight problem, I used the code from Scavenge Survive, I mean precisely this\r\n\r\n[(https://github.com/Southclaw/ScavengeSurvive/blob/d3336c6083037a1f0c45614fde870f660a6b489a/gamemodes/sss/core/player/country.pwn)]\r\n\r\nI rearranged it and remodeled it in order to use the include then I used it in my code, revamped to write the dialogue \"Unknown\" (I do not know if it works, I do not how to test). But when the script I use on a hosted server hosting, so it does not work, it still lists \"Unknown or an empty string '' I do not know what to do was repeated, page http://iphub.info/api.php?ip= works fine , But it can not be.\r\n\r\nhttp://i.imgur.com/W0nQ2Ta.png\r\n\r\nEdited version:\r\n\r\nhttp://i.imgur.com/FY7Y5wN.png\r\n\r\nHosted on the server (gamehosting) it does not work on localhost and also not.\r\nThis is my modified code (Include)\r\n\r\n> `#include <a_samp>\r\n> #include <a_http>\r\n> #include <YSI/y_iterate>\r\n> \r\n> #if !defined isnull\r\n>     #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\\1') && (!(%1[1]))))\r\n> #endif\r\n> \r\n> \r\n> enum E_COUNTRY_DATA\r\n> {\r\n> \t\t\tcntr_Hostname[60],\r\n> \t\t\tcntr_Code[3],\r\n> \t\t\tcntr_Country[92],\r\n> \t\t\tcntr_Region[43],\r\n> \t\t\tcntr_ISP[60],\r\n> \t\t\tcntr_Proxy\r\n> }\r\n> \r\n> \r\n> static\r\n> \t\t\tPlayerCountryData[MAX_PLAYERS][E_COUNTRY_DATA],\r\n> \t\t\tPlayerLookupRetries[MAX_PLAYERS],\r\n> \t\t\tPlayerSessionData[MAX_PLAYERS],\r\n> Iterator:\tPlayerSessionIndex<MAX_PLAYERS>;\r\n> \r\n> static\r\n> \t\t\tMaxRetries = 5;\r\n> \r\n> \r\n> forward OnLookupResponse(sessionid, response, data[]);\r\n> \r\n> \r\n> \r\n> \r\n> _cntr_HandleLogin(playerid)\r\n> {\r\n> \t_cntr_ClearData(playerid);\r\n> \t_cntr_UseDatabase(playerid);\r\n> \t_cntr_UseWeb(playerid);\r\n> }\r\n> \r\n> _cntr_ClearData(playerid)\r\n> {\r\n> \tPlayerCountryData[playerid][cntr_Hostname][0] = EOS;\r\n> \tPlayerCountryData[playerid][cntr_Code][0] = EOS;\r\n> \tPlayerCountryData[playerid][cntr_Country][0] = EOS;\r\n> \tPlayerCountryData[playerid][cntr_Region][0] = EOS;\r\n> \tPlayerCountryData[playerid][cntr_ISP][0] = EOS;\r\n> \tPlayerCountryData[playerid][cntr_Proxy] = 0;\r\n> }\r\n> \r\n> _cntr_UseDatabase(playerid)\r\n> {\r\n> // Causes sqlitei errors for some reason, disabled for now.\r\n> //\tGetPlayerCountry(playerid, PlayerCountryData[playerid][cntr_Country], 45);\r\n> \r\n> \tif(!strcmp(PlayerCountryData[playerid][cntr_Country], \"Unknown\"))\r\n> \t\treturn 0;\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> _cntr_UseWeb(playerid)\r\n> {\r\n> \tnew\r\n> \t\tcell,\r\n> \t\tip[16],\r\n> \t\tquery[60];\r\n> \r\n> \tGetPlayerIp(playerid, ip, sizeof(ip));\r\n> \tformat(query, sizeof(query), \"iphub.info/api.php?ip=%s\", ip);\r\n> \r\n> \tcell = Iter_Free(PlayerSessionIndex);\r\n> \tPlayerSessionData[cell] = playerid;\r\n> \tIter_Add(PlayerSessionIndex, cell);\r\n> \r\n> \tHTTP(cell, HTTP_GET, query, \"\", \"OnLookupResponse\");\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> public OnLookupResponse(sessionid, response, data[])\r\n> {\r\n> \tif(!(0 <= sessionid < MAX_PLAYERS))\r\n> \t{\r\n> \t\tprintf(\"ERROR: OnLookupResponse sessionid out of bounds (%d)\", sessionid);\r\n> \t\treturn;\r\n> \t}\r\n> \r\n> \tnew playerid = PlayerSessionData[sessionid];\r\n> \tIter_Remove(PlayerSessionIndex, sessionid);\r\n> \r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn;\r\n> \r\n> \tif(response != 200 || isnull(data))\r\n> \t{\r\n> \t\tif(PlayerLookupRetries[playerid] < MaxRetries)\r\n> \t\t{\r\n> \t\t\tPlayerLookupRetries[playerid]++;\r\n> \t\t\t_cntr_UseWeb(playerid);\r\n> \t\t}\r\n> \r\n> \t\treturn;\r\n> \t}\r\n> \r\n> \tnew\r\n> \t\tpos,\r\n> \t\tproxy[2];\r\n> \r\n> \t_cntr_GetXMLData(data, \"host\", PlayerCountryData[playerid][cntr_Hostname], pos, 60);\r\n> \t_cntr_GetXMLData(data, \"code\", PlayerCountryData[playerid][cntr_Code], pos, 3);\r\n> \t_cntr_GetXMLData(data, \"country\", PlayerCountryData[playerid][cntr_Country], pos, 92);\r\n> \t_cntr_GetXMLData(data, \"region\", PlayerCountryData[playerid][cntr_Region], pos, 43);\r\n> \t_cntr_GetXMLData(data, \"isp\", PlayerCountryData[playerid][cntr_ISP], pos, 60);\r\n> \t_cntr_GetXMLData(data, \"proxy\", proxy, pos, 2);\r\n> \r\n> \tPlayerCountryData[playerid][cntr_Proxy] = strval(proxy);\r\n> \r\n> \tprintf(\"[COUNTRY] Player country: '%s' (host: '%s' proxy: %d)\",\r\n> \t\tPlayerCountryData[playerid][cntr_Country],\r\n> \t\tPlayerCountryData[playerid][cntr_Hostname],\r\n> \t\tPlayerCountryData[playerid][cntr_Proxy]);\r\n> \r\n> \tif(PlayerCountryData[playerid][cntr_Proxy])\r\n> \t    SendClientMessage(playerid, -1, \"Máš proxy\");\r\n> \t\t//KickPlayer(playerid, \"Proxy connection detected, these are not allowed.\");\r\n> \r\n> \treturn;\r\n> }\r\n> \r\n> _cntr_GetXMLData(string[], tag[], output[], &start, maxlength = sizeof(output))\r\n> {\r\n> \tnew end = start = (strfind(string, tag, true, start) + strlen(tag) + 1);\r\n> \r\n> \twhile(string[end] != '<' && string[end] != '\\0' && end - start < maxlength)\r\n> \t\tend++;\r\n> \r\n> \tstrmid(output, string, start, end, maxlength);\r\n> }\r\n> \r\n> \r\n> stock GetPlayerCountryDataAsString(playerid, output[], len = sizeof(output))\r\n> {\r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn 0;\r\n> \r\n> \tformat(output, len, \"\\\r\n> \t\tHHostname: '%s'\\n\\\r\n> \t\tCode: '%s'\\n\\\r\n> \t\tCountry: '%s'\\n\\\r\n> \t\tRegion: '%s'\\n\\\r\n> \t\tISP: '%s'\\n\\\r\n> \t\tProxy: %s\",\r\n> \t\tPlayerCountryData[playerid][cntr_Hostname],\r\n> \t\tPlayerCountryData[playerid][cntr_Code],\r\n> \t\tPlayerCountryData[playerid][cntr_Country],\r\n> \t\tPlayerCountryData[playerid][cntr_Region],\r\n> \t\tPlayerCountryData[playerid][cntr_ISP],\r\n> \t\tPlayerCountryData[playerid][cntr_Proxy] ? (\"Yes\") : (\"No\"));\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> /*\r\n> stock GetPlayerCountryDataAsString(playerid, output[], len = sizeof(output))\r\n> {\r\n>     new\r\n>         hostname[30],\r\n>         code[30],\r\n>         country[30],\r\n>         region[30],\r\n>         isp[30],\r\n>         proxy[30];\r\n> \r\n>     if(!IsPlayerConnected(playerid))\r\n>         return 0;\r\n> \r\n>     if(strlen(PlayerCountryData[playerid][cntr_Hostname]) == 0) hostname = \"Unknownnn\";\r\n>     else format(hostname, sizeof(hostname), \"%s\", PlayerCountryData[playerid][cntr_Hostname]);\r\n> \r\n>     if(strlen(PlayerCountryData[playerid][cntr_Code]) == 0) code = \"Unknown\";\r\n>     else format(code, sizeof(code), \"%s\", PlayerCountryData[playerid][cntr_Code]);\r\n> \r\n>     if(strlen(PlayerCountryData[playerid][cntr_Country]) == 0) country = \"Unknown\";\r\n>     else format(country, sizeof(country), \"%s\", PlayerCountryData[playerid][cntr_Hostname]);\r\n> \r\n>     if(strlen(PlayerCountryData[playerid][cntr_Region]) == 0) region = \"Unknown\";\r\n>     else format(region, sizeof(region), \"%s\", PlayerCountryData[playerid][cntr_Region]);\r\n> \r\n>     if(strlen(PlayerCountryData[playerid][cntr_ISP]) == 0) isp = \"Unknown\";\r\n>     else format(isp, sizeof(isp), \"%s\", PlayerCountryData[playerid][cntr_ISP]);\r\n> \r\n>     if(strlen(PlayerCountryData[playerid][cntr_Proxy]) == 0) proxy = \"Unknown\";\r\n>     else format(proxy, sizeof(proxy), \"%s\", PlayerCountryData[playerid][cntr_Proxy]);\r\n> \r\n> \r\n>     format(output, len, \"\\\r\n>         HHostname: '%s'\\n\\\r\n>         Code: '%s'\\n\\\r\n>         Country: '%s'\\n\\\r\n>         Region: '%s'\\n\\\r\n>         ISP: '%s'\\n\\\r\n>         Proxy: %s\",\r\n>         hostname,\r\n>         code,\r\n>         country,\r\n>         region,\r\n>         isp,\r\n>         proxy\r\n>          ? (\"Yes\") : (\"No\"));\r\n> \r\n>     return 1;\r\n> }\r\n> */\r\n> // cntr_Hostname[60],\r\n> stock GetPlayerCachedHostname(playerid, output[], len = sizeof(output))\r\n> {\r\n>     //if(!strcat(PlayerCountryData[playerid][cntr_Hostname], \"Unknown\")\r\n> \toutput[0] = EOS;\r\n> \tstrcat(output, PlayerCountryData[playerid][cntr_Hostname], len);\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> // cntr_Code[3],\r\n> stock GetPlayerCachedCountryCode(playerid, output[], len = sizeof(output))\r\n> {\r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn 0;\r\n> \r\n> \toutput[0] = EOS;\r\n> \tstrcat(output, PlayerCountryData[playerid][cntr_Code], len);\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> // cntr_Country[45],\r\n> stock GetPlayerCachedCountryName(playerid, output[], len = sizeof(output))\r\n> {\r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn 0;\r\n> \r\n> \toutput[0] = EOS;\r\n> \tstrcat(output, PlayerCountryData[playerid][cntr_Country], len);\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> // cntr_Region[43],\r\n> stock GetPlayerCachedRegion(playerid, output[], len = sizeof(output))\r\n> {\r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn 0;\r\n> \r\n> \toutput[0] = EOS;\r\n> \tstrcat(output, PlayerCountryData[playerid][cntr_Region], len);\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> // cntr_ISP[60],\r\n> stock GetPlayerCachedISP(playerid, output[], len = sizeof(output))\r\n> {\r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn 0;\r\n> \r\n> \toutput[0] = EOS;\r\n> \tstrcat(output, PlayerCountryData[playerid][cntr_ISP], len);\r\n> \r\n> \treturn 1;\r\n> }\r\n> \r\n> // cntr_Proxy\r\n> stock IsPlayerUsingProxy(playerid)\r\n> {\r\n> \tif(!IsPlayerConnected(playerid))\r\n> \t\treturn 0;\r\n> \r\n> \treturn PlayerCountryData[playerid][cntr_Proxy];\r\n> }\r\n> \r\n\r\nBasic,.\r\n\r\n> #include <a_samp>\r\n> #include <zcmd>\r\n> #include <base.pwn>\r\n> \r\n> CMD:checkex2(playerid, params[])\r\n> {\r\n> \tnew dating[255];\r\n> \tGetPlayerCountryDataAsString(playerid, dating);\r\n> \tShowPlayerDialog(playerid, 4874, DIALOG_STYLE_MSGBOX, \"Title\", dating, \"Zavřít\", \"\");\r\n> \treturn 1;\r\n> }\r\n> \r\n> CMD:checkex(playerid, params[])\r\n> {\r\n>     new targetid, dat[255], checkexString[255], IpEx[20];\r\n>     if(sscanf(params,\"u\", targetid)) return SendClientMessage(playerid, -1,\"SYNTAXE: /checkex [playerid]\");\r\n>     if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1,\"This player isn't connected.\");\r\n>     GetPlayerIp(playerid,IpEx,sizeof(IpEx));\r\n>     format(checkexString,sizeof(checkexString), \"%s ( %i ) %s\",ReturnPlayerName(targetid), targetid, IpEx);\r\n> \tGetPlayerCountryDataAsString(targetid, dat);\r\n> \tShowPlayerDialog(playerid, 4874, DIALOG_STYLE_MSGBOX, checkexString, dat, \"Close\", \"\");\r\n> \treturn 1;\r\n> }"},"comment":{"url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/issues/comments/199321226","html_url":"https://github.com/Southclaw/ScavengeSurvive/issues/190#issuecomment-199321226","issue_url":"https://api.github.com/repos/Southclaw/ScavengeSurvive/issues/190","id":199321226,"user":{"login":"DarkQuery","id":10682806,"avatar_url":"https://avatars.githubusercontent.com/u/10682806?v=3","gravatar_id":"","url":"https://api.github.com/users/DarkQuery","html_url":"https://github.com/DarkQuery","followers_url":"https://api.github.com/users/DarkQuery/followers","following_url":"https://api.github.com/users/DarkQuery/following{/other_user}","gists_url":"https://api.github.com/users/DarkQuery/gists{/gist_id}","starred_url":"https://api.github.com/users/DarkQuery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarkQuery/subscriptions","organizations_url":"https://api.github.com/users/DarkQuery/orgs","repos_url":"https://api.github.com/users/DarkQuery/repos","events_url":"https://api.github.com/users/DarkQuery/events{/privacy}","received_events_url":"https://api.github.com/users/DarkQuery/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T14:44:30Z","updated_at":"2016-03-21T14:44:30Z","body":"Yesterday, he goes iphub.info but later he was back in operation, but I want to test whether it will work on other gaming providers and see what else was repeated as Southclaw says that the code (Country.pwn) works as intended and information from iphub.info is written into the game (SAMP Server)"}}