View Full Version : Showing the IP on /stats and /check

22/07/2013, 04:04 PM
Hey.. so I wanna show the IP of the player on /stats and /check, I've got everything done already regarding /stats. It's an RP server.. and for admins when you do /stats and /check the admins can an extra line of info, like on the GF.

So, here's what I've done up to now:

public ShowStats(playerid,targetid)
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));

That's just for the bit I am struggling on, the rest is unnecessary to post here.

format(string, sizeof(string), "IP:[%d]",plrIP);
SendClientMessage(playerid, COLOR_LIGHTRED,string);

I got rid of the unnecessary stuff those 2 lines too, so now, when I compile and run it, it comes up with no errors whatsoever. When I go in game, I type /stats and for every player it just says IP:[49] whereas it should show the full IP of that player.

All the code above is the code I've got regarding the IP, I've got nothing else to do with any sort of IP on the script.

22/07/2013, 04:09 PM
Try this:

format(string, sizeof(string), "IP:[%s]",plrIP);

22/07/2013, 04:22 PM
Worked, thanks.