Format() setting

Started by KAKAN, Oct 02, 2015, 01:39 PM

Previous topic - Next topic

KAKAN

Okay, yesterday my router got fucked up in a thunder-lightening, so port-forward is not possible
Currently, I'm using mobile net, from which port-forward is not possible.
So can anyone try this for me? OR can anyone say that this one will work or not?
local country = geoip_country_name_by_addr(player.IP);
    if (country != null) EMessage( format("*> %s is connecting from %s <*",player.Name, country) );
    else EMessage( format("%s in connecting from Unknown",player.Name) );
When I connect from localhost, it messages KAKAN is connecting from Unknown,
so I'm not sure that the upper-one will work or not, can anyone try it?
oh no

Kirollos

Isn't it supposed to do that? You are connecting from localhost, and you shouldn't expect a geoip data from 127.0.0.1.

KAKAN

Ahh, you didn't understand.
I mean that the lower one(with else) is working, but I'm not sure about the upper one(if), because of the reasons stated above(in the topic)
oh no

DizzasTeR

Just make it, if( country ) ...

KAKAN

Okay THANKS! Sloved, Locked
oh no

Thijn

You can always get your external IP and paste it directly in that code, instead of player.IP