SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 30/03/2018, 05:58 PM   #1
Lixyde
Big Clucker
 
Join Date: Feb 2018
Posts: 92
Reputation: 1
Default GetPlayerIp Bug?

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:

Code:
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?
__________________
Code:
Hello!
Lixyde is offline   Reply With Quote
Old 30/03/2018, 06:02 PM   #2
kovac
Banned
 
Join Date: Mar 2018
Posts: 178
Reputation: 14
Default Re: GetPlayerIp Bug?

%s for IP
http://wiki.sa-mp.com/wiki/Format
kovac is offline   Reply With Quote
Old 30/03/2018, 06:06 PM   #3
Lixyde
Big Clucker
 
Join Date: Feb 2018
Posts: 92
Reputation: 1
Default Re: GetPlayerIp Bug?

I still can't understand the thing with:
%s
%d
%i
Even if i see how it is on the samp site
__________________
Code:
Hello!
Lixyde is offline   Reply With Quote
Old 30/03/2018, 06:49 PM   #4
ivndosos
Huge Clucker
 
ivndosos's Avatar
 
Join Date: Sep 2014
Location: Russian Federation, Kaliningrad.
Posts: 403
Reputation: 18
Default Re: GetPlayerIp Bug?

Code:
  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

*/
__________________
ivndosos is offline   Reply With Quote
Old 30/03/2018, 07:26 PM   #5
!R1Ch@rD!
Gangsta
 
!R1Ch@rD!'s Avatar
 
Join Date: Jun 2012
Location: Ecuador
Posts: 649
Reputation: 14
Default Re: GetPlayerIp Bug?

As the users of above say it is not %d if not %s greetings.

pawn Code:
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);
__________________

I want to learn pawno

!R1Ch@rD! 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
GetPlayerIP ccodey Scripting Help 5 01/03/2017 10:24 AM
[Ajuda] GetPlayerIp Zivo PortuguÍs/Portuguese 4 15/10/2013 01:39 PM
GetPlayerIp Test23 Scripting Help 11 24/12/2012 11:26 PM
GetPlayerIp... mrsamp Scripting Help 6 20/07/2012 08:34 PM
GetPlayerIP help LiamM Scripting Help 7 22/01/2012 10:21 PM


All times are GMT. The time now is 07:21 PM.


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