Y_ini Problem! [Rep+] -
Audi_Quattrix - 02.02.2014
All the stats except Password and Ip aren`t saving!
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new h, m, s;
TotalGameTime(playerid, h, m, s);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteInt(File,"Cookies",PlayerInfo[playerid][pCookies]);
INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File,"Seconds",s);
INI_WriteInt(File,"Minutes",m);
INI_WriteInt(File,"Hours",h);
INI_WriteString(File, "Ip",GetPlayerIPEx(playerid));
INI_Close(File);
return 1;
}
Re: Y_ini Problem! [Rep+] -
rakshith122 - 02.02.2014
For IP use this :
Add this below new h, m, s.
pawn Код:
Replace that IP with this
GetPlayerIp(playerid, pIp, sizeof(pIp));
INI_WriteString(File,"Ip",PlayerInfo[playerid][pIp]);
Not sure if it will work, Just try.
Re: Y_ini Problem! [Rep+] -
Don_Cage - 02.02.2014
Just a note: I recommend that you make something to store money in else you will have alot of hacked money in your server.
Re: Y_ini Problem! [Rep+] -
Audi_Quattrix - 02.02.2014
First i need to fix this problem. Then i will improve security.
Re: Y_ini Problem! [Rep+] -
Sawalha - 02.02.2014
INI_WriteString is for writing a string, not an integer, so you should use INI_WriteInt for saving an IP
at registering system or code you use,
the password would be:
pawn Код:
INI_WriteString(File, "Password", inputtext);
or what ever you use as text for the password
Re: Y_ini Problem! [Rep+] -
Audi_Quattrix - 02.02.2014
There is no problems with ip saving.
And IP is a string.
Re: Y_ini Problem! [Rep+] -
Konstantinos - 02.02.2014
I'd like to point out that getting the IP while a player is disconnecting, the IP will be 255.255.255.255
Also about the password, I don't see any reason why would you like to save the password again. Write the password in the file once a player is about to register and save the password again only if a player wants to change their password. Anything else is pretty much pointless to me.
Re: Y_ini Problem! [Rep+] -
Audi_Quattrix - 02.02.2014
I dont save Password on each Disconnect.