30.05.2011, 13:50
Hey guys,
I got a problem with saving playerdata into an .ini
When some-one logs out (disconnect), then im getthing this:
What to do to get the ip right?
I got a problem with saving playerdata into an .ini
When some-one logs out (disconnect), then im getthing this:
Код:
Name=Alusion[NL] Ip=255.255.255.255 // <-- should be 127.0.0.1 Registered=0 // <-- should be 1 Password=313656198 Level=0 Money=500 Score=0 Vip=0
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new file[200], name[MAX_PLAYER_NAME], ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), PlayerFile, name);
dini_Set(file, "Name", name);
dini_Set(file, "Ip", ip);
dini_IntSet(file, "Registered", gPlayerInfo[playerid][PLAYER_REGGED]);
dini_IntSet(file, "Password", gPlayerInfo[playerid][PLAYER_PASS]);
dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
dini_IntSet(file, "Vip", gPlayerInfo[playerid][PLAYER_VIP]);
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
gPlayerLogged[playerid] = 0;
return 1;
}