Showing the IP on /stats and /check - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Showing the IP on /stats and /check (
/showthread.php?tid=452760)
Showing the IP on /stats and /check -
DanishHaq - 22.07.2013
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:
Code:
public ShowStats(playerid,targetid)
{
if(IsPlayerConnected(playerid)&&IsPlayerConnected(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.
Code:
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.
Re: Showing the IP on /stats and /check -
Remba031 - 22.07.2013
Try this:
format(string, sizeof(string), "IP:[%s]",plrIP);
Re: Showing the IP on /stats and /check -
DanishHaq - 22.07.2013
Worked, thanks.