GetPlayerIp Bug? - 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: GetPlayerIp Bug? (
/showthread.php?tid=651916)
GetPlayerIp Bug? -
Lixyde - 30.03.2018
So i tried to make when a player connect to say:
You registered: Lixyde, Password: <pass>, IP: <playerip>
But there is something wrong and i dont understand why is wrong.
It says that my is 50 ?? That's impossible, where is the problem?
Here is pic:
https://imgur.com/a/jaxra
Here is the code that i have:
Код:
new Name[MAX_PLAYER_NAME];
new string[256];
new PlayerIP[16];
GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "SERVER: {FFFFFF}You registered: {FFE600}%s, {FFFFFF}Password: {FFE600}%s, {FFFFFF}IP: {FFE600}%d{FFFFFF}!", Name, inputtext, PlayerIP);
SendClientMessage(playerid, COLOR_SYSTEM, string);
Where is the problem? How to fix it?
Re: GetPlayerIp Bug? -
kovac - 30.03.2018
%s for IP
https://sampwiki.blast.hk/wiki/Format
Re: GetPlayerIp Bug? -
Lixyde - 30.03.2018
I still can't understand the thing with:
%s
%d
%i
Even if i see how it is on the samp site
Re: GetPlayerIp Bug? -
ivndosos - 30.03.2018
Код:
Specifiers:
Format Use
L(true/false) Optional logical truthity
l Logical truthity
B(binary) Optional binary number
b Binary number
N(any format number) Optional number
n Number
C(character) Optional character
c Character
I(integer) Optional integer
i Integer
D(integer) Optional integer
d Integer
H(hex value) Optional hex number
h Hex number
O(octal value) Optional octal value
o Octal value
F(float) Optional floating point number
f Floating point number
G(float/INFINITY/-INFINITY/NAN/NAN_E) Optional float with IEEE definitions
g Float with IEEE definitions
{ Open quiet section
} Close quiet section
P<delimiter> Invalid delimiter change
p<delimiter> Delimiter change
Z(string)[length] Invalid optional string
z(string)[length] Deprecated optional string
S(string)[length] Optional string
s[length] String
U(name/id) Optional user (bot/player)
u User (bot/player)
Q(name/id) Optional bot (bot)
q Bot (bot)
R(name/id) Optional player (player)
r Player (player)
A<type>(default)[length] Optional array of given type
a<type>[length] Array of given type
E<specification>(default) Optional enumeration of given layout
e<specification> Enumeration of given layout
'string' Search string
% Deprecated optional specifier prefix
*/
Re: GetPlayerIp Bug? -
!R1Ch@rD! - 30.03.2018
As the users of above say it is not %d if not %s greetings.
pawn Код:
new Name[MAX_PLAYER_NAME];
new string[256];
new PlayerIP[16];
GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "SERVER: {FFFFFF}You registered: {FFE600}%s, {FFFFFF}Password: {FFE600}%s, {FFFFFF}IP: {FFE600}%s{FFFFFF}!", Name, inputtext, PlayerIP);
SendClientMessage(playerid, COLOR_SYSTEM, string);