GetPlayerIp Bug?
#1

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?
Reply
#2

%s for IP
https://sampwiki.blast.hk/wiki/Format
Reply
#3

I still can't understand the thing with:
%s
%d
%i
Even if i see how it is on the samp site
Reply
#4

Код:
  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

*/
Reply
#5

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)