SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/07/2013, 04:04 PM   #1
DanishHaq
High-roller
 
Join Date: Sep 2011
Location: Manchester, England, United Kingdom
Posts: 1,351
Reputation: 134
Default Showing the IP on /stats and /check

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.
DanishHaq is offline   Reply With Quote
Old 22/07/2013, 04:09 PM   #2
Remba031
Little Clucker
 
Join Date: Aug 2010
Posts: 47
Reputation: 2
Default Re: Showing the IP on /stats and /check

Try this:

format(string, sizeof(string), "IP:[%s]",plrIP);
Remba031 is offline   Reply With Quote
Old 22/07/2013, 04:22 PM   #3
DanishHaq
High-roller
 
Join Date: Sep 2011
Location: Manchester, England, United Kingdom
Posts: 1,351
Reputation: 134
Default Re: Showing the IP on /stats and /check

Worked, thanks.
DanishHaq is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
showing stats help WardenCS Scripting Help 3 27/06/2013 09:13 PM
Showing stats from mysql Larry123 Scripting Help 0 23/12/2012 02:46 PM
Showing stats as bars oblexive Scripting Help 2 28/07/2012 09:38 AM
Showing Only One Check Point! iOmar Scripting Help 13 21/06/2012 11:46 AM
Question about showing server stats on a website HireMe Help Archive 2 01/11/2010 07:54 PM


All times are GMT. The time now is 07:56 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.