SA-MP Forums Archive
[HELP] Saving IP with dini <> Help!! D: bump bump - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Saving IP with dini <> Help!! D: bump bump (/showthread.php?tid=154174)



[HELP] Saving IP with dini <> Help!! D: bump bump - NitroSWA - 12.06.2010

Hey,
im making an auto login, and i need to save ip's
when i use dini_IntSet my ip is 15
when i use dini_FloatSet my ip is 15.000000
when i use dini_Set my ip is 255.255.255.255 (in my test server and in my FSCK server (for every1))
tmp3 is getplayerip balblabla and i use tmp3 to put in dini,
but in printf, it is the right ip,

what do i need to do?

if u need more info, just ask, i hope its clear. :\


Re: [HELP] Saving IP with dini - DJDhan - 12.06.2010

Код:
GetPlayerIp(playerid,tmp3,100);
dini_Set(file,"Ip",tmp3);
Treat tmp3 as a string and not a integer variable.


Re: [HELP] Saving IP with dini - NitroSWA - 12.06.2010

Quote:
Originally Posted by DJDhan
Код:
GetPlayerIp(playerid,tmp3,100);
dini_Set(file,"Ip",tmp3);
Treat tmp3 as a string and not a integer variable.
i already use dini_Set, but then my ip is 255.255.255.255 in my user file,
but i also made a printf with also tmp3, and i see in my console, my normal ip, (same tmp3 i use for files)


Re: [HELP] Saving IP with dini - lolumadd - 12.06.2010

You are saving the IP under OnPlayerDisconnect. When you put it their, the output of the IP will always be the 255.255.255.255. You must put the code somewhere else.


Re: [HELP] Saving IP with dini - DJDhan - 12.06.2010

That's weird. Do you have it under OnPlayerConect or OnPlayerDisconnect?


Re: [HELP] Saving IP with dini - NitroSWA - 12.06.2010

ehum...

xD..
i got it under onplayerdisconnect xD

EDIT:
alright, now i have to compare them with each other, and if they are the same, he logs in,
but i use
dini_Get(file,"Ip"); and its blank
not a number but nothing :S


Re: [HELP] Saving IP with dini <> Help!! D: bump bump - lolumadd - 12.06.2010

I dont recommend what you are doing because a lot of peoples ip's change dynamically. But do this:

pawn Код:
public OnPlayerConnect(playerid)
{
new ip[64],newip[64];
ip = dini_Get(file, "Ip");
GetPlayerIp(playerid, ip, sizeof(ip)); //function params i forgot xD might have to correct this
if(strcmp(ip, newip, true) == 0)
{
LoginPlayer..
}
else
{
Kick(playerid); // ip doesnt match in file
}
return 1;
}



Re: [HELP] Saving IP with dini <> Help!! D: bump bump - NitroSWA - 12.06.2010

ok thx,

gonna try tomorrow, im on my psp now xD


Re: [HELP] Saving IP with dini <> Help!! D: bump bump - Hiddos - 12.06.2010

IP's asked for at OnPlayerDisconnect always return 255.255.255.255. You might wish to save their IP to a global string to recover it when the player disconnects.


Re: [HELP] Saving IP with dini <> Help!! D: bump bump - NitroSWA - 13.06.2010

i now got it on /login, and it saves good.
i hope dini_Get works to load the ip.
gonna test when im on my pc