How to add IP address on Y_INI?
#1

I tried to add IP address on Y_INI but I failed.

It shows: "Your IP: 0"

How to add it?

pawn Код:
INI_WriteINT(file,"IP",GetPlayerIP(playerid, //then wat?
:/
Reply
#2

No no no.
IP Address is not a integer it is a string

pawn Код:
new ip[16];
GetPlayerIp(playerid, ip, 16);
INI_WriteString(file, "IP", ip);
Reply
#3

Now I've almost solved all the thing but this!
pawn Код:
INI_String("IP", pInfo[playerid][Ip]);
Errors:
Код:
C:\Documents and Settings\User\Desktop\0.3x script\gamemodes\stuntproject.pwn(1073) : error 017: undefined symbol "INI_String"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
:/
Reply
#4

pawn Код:
INI_String("IP", pInfo[playerid][Ip], 16);
Reply
#5

Jake is faster than me...Try what he said.
Reply
#6

Yes, it's solved but THIS!!!

pawn Код:
GetPlayerIp(playerid, Ip, 16);
    INI_WriteString(file,"IP",Ip);
*OnPlayerDisconnect

Код:
C:\Documents and Settings\User\Desktop\0.3x script\gamemodes\stuntproject.pwn(194) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\User\Desktop\0.3x script\gamemodes\stuntproject.pwn(195) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

2 Errors.
Reply
#7

Try this:

pawn Код:
GetPlayerIp(playerid, ip, 16);
    INI_WriteString(file,"IP",ip);
Ip shall be ip
Reply
#8

LeeXian you've added Ip on Enum.
Change the other Ip to lower cased ip.
Reply
#9

Don't save an IP when player disconnects. The IP will be like; 255.255.255.255
Reply
#10

^^

Oh ye i forgot to tell you about that.

Here is the technique if you are using the IP for auto login.
Update the ip everytime player logged in.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)