IP problem
#1

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");
}
}

Reply
#2

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

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

and where is that stock (its a function) is?
Reply
#5

////
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)