Not displaying the full IP address.
#1

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");
Reply
#2

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

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

Try to change "new plrIP[16];" to "new plrIP[50]"
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)