14.12.2012, 02:12
Sigh; it is 5:30 in the morning, I can't believe I actually told someone to store IP in a MAX_PLAYERS array.
Also, LarzI, you didn't update the wrong code, here it is:
edit:
Also @ OP, make sure you edit the loading callback to load a STRING named IP, not an integer, or it will load as xxx instead of xxx.xxx.xxx.xxx
Also, LarzI, you didn't update the wrong code, here it is:
pawn Код:
case DIALOG_REGISTER:
{
if(!response)
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","{FF0000}You have entered an invalid password.\n""Type your password below to register a new account.","Register","Quit");
}
if(response)
{
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
new IP[16];
GetPlayerIp(playerid,IP,16);
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",1500);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"NoPm",0);
INI_WriteInt(File,"Mute",0);
INI_WriteInt(File,"Vip",0);
INI_WriteInt(File,"C4",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Cookies",0);
INI_WriteInt(File,"Warn",0);
INI_WriteInt(File, "RegisterDate_day", Day);
INI_WriteInt(File, "RegisterDate_mon", Month);
INI_WriteInt(File, "RegisterDate_year",Year);
INI_WriteInt(File, "RegisterDate_hour",Hour);
INI_WriteInt(File, "RegisterDate_min", Minute);
INI_WriteInt(File, "RegisterDate_sec", Second);
INI_WriteString(File, "Ip", IP);
INI_WriteInt(File, "Min", 0);
INI_WriteInt(File, "Hour", 0);
INI_WriteInt(File, "Sec", 0);
INI_WriteInt(File, "Jailed", 0);
INI_WriteInt(File, "Logged", 1);
INI_WriteInt(File, "AdminActions", 0);
INI_WriteInt(File, "Rank", 0);
INI_Close(File);
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetTimerEx("TimeOnServer", 1000, 1, "i", playerid);
SetPlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pRank]);
SCM(playerid,-1,"{F70505}Registered and autologged! {FF0000}Now all your data are auto saved.");
TotalRegister++;
new msg[128], name[MAX_PLAYER_NAME];
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "4%s (%d) has registered a new account on Cod Samp - Ip: %s - %02d/%02d/%d - %02d:%02d:%02d - Total Accounts: %d", name, playerid,IP,Day,Month,Year,Hour,Minute,Second,TotalRegister);
IRC_GroupSay(gGroupID, IRC_ACHANNEL, msg);
format(msg, sizeof(msg), "%s (%d) has registered a new account on Cod Samp - Ip: %s - %02d/%02d/%d - %02d:%02d:%02d - Total Accounts: %d", name, playerid,IP,Day,Month,Year,Hour,Minute,Second,TotalRegister);
AccountsLog(msg);
format(LastAccount,sizeof(LastAccount),"%s (%d) has registered a new account on Cod Samp - Ip: %s - %02d/%02d/%d - %02d:%02d:%02d - Total Accounts: %d", name, playerid,IP,Day,Month,Year,Hour,Minute,Second,TotalRegister);
}
Also @ OP, make sure you edit the loading callback to load a STRING named IP, not an integer, or it will load as xxx instead of xxx.xxx.xxx.xxx