OnPlayerDisconnect - saving ip - 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: OnPlayerDisconnect - saving ip (
/showthread.php?tid=389450)
OnPlayerDisconnect - saving ip -
Socan - 02.11.2012
I have this code under OnPlayerConnect but I'm getting an error;
Код:
C:\Users\School\Desktop\DH\gamemodes\drift.pwn(503) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
I can't seem too find whats wrong and any help thats given is very apreciated!
Код:
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
if(fexist(file)){
GetPlayerPos(playerid, X, Y, Z);
dini_FloatSet(file, "LastX", X);
dini_FloatSet(file, "LastY", Y);
dini_FloatSet(file, "LastZ", Z);
dini_FloatSet(file, "IP", ip);
dini_IntSet(file, "Cash", GetPlayerMoney(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
}
Re: OnPlayerDisconnect - saving ip -
zSuYaNw - 02.11.2012
Float is string.
pawn Код:
dini_Set(file, "IP", ip);
Re: OnPlayerDisconnect - saving ip - Glint - 02.11.2012
He meant an IP is a string.
Re: OnPlayerDisconnect - saving ip -
Glad2BeHere - 02.11.2012
GetPlayerIp(playerid, IP, sizeof(IP));
dini_Set(file, "IP", IP);
Re: OnPlayerDisconnect - saving ip -
doreto - 02.11.2012
You cannot save ip when player disconnect (most like it will give you 255.255.255.255 or 0)
Re: OnPlayerDisconnect - saving ip -
Glad2BeHere - 02.11.2012
u can get it when he connect