SA-MP Forums Archive
Not displaying the full IP address. - 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: Not displaying the full IP address. (/showthread.php?tid=482291)



Not displaying the full IP address. - Stuffs - 20.12.2013

Hello guys,
It's my first time working with the GetPlayerIp function and I can't seem to display the full IP address.
Could someone help me.

This is how it's suppose to look like:


But it just displays 49.

Here's my code:
pawn Код:
new string[256];
        new plrIP[16];
        GetPlayerIp(playerid, plrIP, sizeof(plrIP));
        format(string, sizeof(string), ""COL_WHITE"Welcome!\n\n"COL_WHITE"Username: "COL_LIGHTBLUE"%s\n"COL_WHITE"IP Address: "COL_LIGHTBLUE"%d\n\nEnter your desired password below.", GetPlayerNameEx(playerid), plrIP);
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"Registration Process", string, "Register", "Quit");



Re: Not displaying the full IP address. - Vince - 20.12.2013

An IP address is a string and should therefore be displayed with the '%s' placeholder.


Re: Not displaying the full IP address. - Stuffs - 20.12.2013

Oh, my bad. I thought because it contained numbers it was the '%d' placeholder. Thanks Vince it worked!


Re: Not displaying the full IP address. - RedSnow - 20.12.2013

Try to change "new plrIP[16];" to "new plrIP[50]"


Re: Not displaying the full IP address. - Pottus - 20.12.2013

Quote:
Originally Posted by RedSnow
Посмотреть сообщение
Try to change "new plrIP[16];" to "new plrIP[50]"
This made me LOL


Re: Not displaying the full IP address. - Stuffs - 20.12.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
This made me LOL
4char