PHP Code:
case "locate":
if(!(self checkIfAdmin()))
return;
if (isDefined(args[2]) && isint(args[2]))
{
args[2] = int(args[2]);
if(!checkIfExist(args[2]))
{
self thread tellMessage("Couldn\'t find a player with this number.");
return;
}
player = getplayerbyid();
ip = player getip();
ip_parts = [];
part = 0;
ip_parts[part] = "";
prev_found = 0;
for(i = 0; i < ip.size; i++)
{
if(ip[i] != ".")
ip_parts[part] += ip[i];
else
{
part++;
ip_parts[part] = "";
}
}
multi = 1;
num = 0;
for(i = ip_parts.size - 1; i >= 0; i--)
{
num += int(ip_parts[i]) * multi;
multi *= 256;
}
args = [];
args[0] = player;
maps\mp\gametypes\_mysql::asyncQuery("SELECT country FROM countries WHERE ip < " + num + " ORDER BY ip DESC LIMIT 1", ::showLocation, args);
return;
}
thread tellmessage("Usage : !locate playernum");
return;
PHP Code:
showlocation(rows, args)
{
if(!isdefined(args[0]))
return;
if(isdefined(rows) && isdefined(rows[0]) && isdefined(rows[0]["country"]))
self iprintlnbold(args[0].name + "^7 is from ^2" + getlongcountry(rows[0]["country"]));
}
failed to notice the problem. can you fix the code please ?
I got the car here and his model