SA-MP Forums Archive
IP problem - 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: IP problem (/showthread.php?tid=647538)



IP problem - pulsare - 06.01.2018

Hey,

I used this thread for a new topic.

I'm sitting in front of the PC for an hour and can not find a solution even though it's so EASY

is an IP store.

At Stock: Login
Quote:

source
new IP [128];
GetPlayerIp (playerid, IP, sizeof (IP));
dini_Set (players, "PlayerIp" IP);


If the IP (Successful) is set, but after login it is 0 again.

But you can not save Dini value unless you just use an enum and then use it for example with PlayerInfo or with me sPlayer

Normally you do not even have to save it, so I am surprised that it is 0 after disconnecting. Have the Enum

also completely removed, so that it can not be set to the value of Enums, but has brought nothing.

With the Enum, I have tried synonymous, but has only the first 2 digits of the IP stored otherwise nothing

is so for example so (no right IP)


The IP is: 42.28.185.189

And only the 42 was saved.


& The car mechanic does not work (that is, you get the dialogue)


If I simply enter the IP with Dini by hand, the autologin works without problems.

It is always set to 0 ....
source
Quote:

if (! strcmp (IP, dini_Get (Player, "PlayerIp")))
if (! strcmp (IP, splayer [playerid] [PlayerIp]))


source
if (listitem == 0)
{
new IP [128];
GetPlayerIp (playerid, IP, sizeof (IP));
new player [64];
new Sname [MAX_PLAYER_NAME];
GetPlayerName (playerid, Sname, sizeof (Sname));
format (players, sizeof (player), "/ player /% s.txt" Sname);
sPlayer [playerid] [PlayerIp] = dini_Int (player, "PlayerIp");
if (! strcmp (IP, dini_Get (Player, "PlayerIp")))
{
LoadPlayer (playerid);
SpawnPlayer (playerid);
Logined [playerid] = 1;
ShowPlayerDialog (playerid, 38, DIALOG_STYLE_MSGBOX, "Notice", "You were Auto - Logged", "Close", "");
return 1;
}
else
{
ShowPlayerDialog (playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Login: Enter your Password", "Login", "Cancel");
}
}




Re: IP problem - RogueDrifter - 06.01.2018

You can't use GetPlayerIp at OnPlayerDisconnect... make sure you don't have that at OnPlayerDisconnect


Re: IP problem - pulsare - 06.01.2018

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
You can't use GetPlayerIp at OnPlayerDisconnect... make sure you don't have that at OnPlayerDisconnect
It isnt

Its on Stock LoadPlayer(playerid);


Re: IP problem - RogueDrifter - 06.01.2018

and where is that stock (its a function) is?


Re: IP problem - pulsare - 08.01.2018

////


Re: IP problem - ilijap - 09.01.2018

Код:
new IP [128];
GetPlayerIp (playerid, IP, sizeof (IP));
dini_Set (players, "PlayerIp", IP);