Filewriting with getplayerip - 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: Filewriting with getplayerip (
/showthread.php?tid=308772)
Filewriting with getplayerip -
SomebodyAndMe - 05.01.2012
is the following thing possible?
If not, could someone explain on how to do it correctly?
pawn Код:
format(LineForFile, 100, "IP Adress %s\r\n", GetPlayerIp(playerid, playerip, sizeof(playerip))); // Construct the line: "IP adress"
fwrite(PFile, LineForFile); // And save it to the file
Re: Filewriting with getplayerip -
Norck - 05.01.2012
GetPlayerIp doesn't return an IP, it stores ip into the passed string, sot it should be like this:
pawn Код:
new ip[32];
GetPlayerIp(playerid,ip,sizeof(ip));
format(LineForFile, 100, "IP Adress %s\r\n",ip); // Construct the line: "IP adress"
fwrite(PFile, LineForFile); // And save it to the file