[HELP]Save ip
#1

Hi guys. I would ask if you can create a system to save the ip of the player. Who is kind enough to post?
Thank guys.
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerIp
use dubd or something to put it in a file
Reply
#3

Thank
Reply
#4

Tutorial for a Register/Login system wich save player statistics. In the tutorial you learn how to save some things in a text file.. https://sampforum.blast.hk/showthread.php?tid=163746
Reply
#5

I do not understand you. I wish the ip you saved in my pc, in a IPlog.
Show me a guide. Goodbye
Reply
#6

Carbon, thanks for your work but I would like it without the registration system
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
        new string[256], pname[MAX_PLAYER_NAME], IP[16];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "/User IPs/IP_%s.ini", pname);
        dini_Create(string);
        dini_Set(string, "UserIP", GetPlayerIP(playerid, IP, sizeof(IP)));
    return 1;
}
Just easy: When a player connect his IP will be saved in Your_GTA_Folder/scriptfiles/User IPs as "IP_*username*.ini". When you open the .ini file you see: UserIP *IP of the User*..

I don't tested it. Hope it'll work.
Reply
#8

Quote:
Originally Posted by gabrissxxx
Посмотреть сообщение
Carbon, thanks for your work but I would like it without the registration system
The tutorial shows you how to store variables in a file. Due to the fact that the IP also is a variable, you can just replace the values that are needed in a registration with the IP.

But because you just want to save an IP into one file, I would furthermore suggest the file-functions fopen, and fwrite. If you ask yourself which mode you should chose for fwrite, in my opinion IO_APPEND would make sense in this case.
Reply
#9

1 Error and 2 warning:

Код:
C:\Users\Gabri\Desktop\[IWG]\gamemodes\Gamemode[IWG].pwn(403) : warning 202: number of arguments does not match definition
C:\Users\Gabri\Desktop\[IWG]\gamemodes\Gamemode[IWG].pwn(403) : warning 202: number of arguments does not match definition
C:\Users\Gabri\Desktop\[IWG]\gamemodes\Gamemode[IWG].pwn(403) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PHP код:
dini_Create(string);
dini_Set(string"UserIP"GetPlayerIp(playerid)); 
Reply
#10

Quote:
Originally Posted by gabrissxxx
Посмотреть сообщение
1 Error and 2 warning:

Код:
C:\Users\Gabri\Desktop\[IWG]\gamemodes\Gamemode[IWG].pwn(403) : warning 202: number of arguments does not match definition
C:\Users\Gabri\Desktop\[IWG]\gamemodes\Gamemode[IWG].pwn(403) : warning 202: number of arguments does not match definition
C:\Users\Gabri\Desktop\[IWG]\gamemodes\Gamemode[IWG].pwn(403) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PHP код:
dini_Create(string);
dini_Set(string"UserIP"GetPlayerIp(playerid)); 
pawn Код:
public OnPlayerConnect(playerid)
{
    new string[256], pname[MAX_PLAYER_NAME], IP[16];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "/User IPs/IP_%s.ini", pname);
    GetPlayerIp(playerid, IP, sizeof(IP));
    dini_Set(string, "UserIP", IP);
    dini_Create(string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)