14.12.2012, 18:19
INI_SetTag(handler,...); - Instead of using 'file' in INI functions, use handler and try.
Edit: Edited script.
Edit: Edited script.
pawn Код:
CMD:register(playerid, params[])
{
if(!params[0]) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /register [password]");
new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name));
new file[128];
format(file, sizeof(file), "/Users/%s.ini", name);
new INI:handler = INI_Open(file);
INI_SetTag(handler,"data");
INI_WriteInt(handler,"Password",udb_hash(params));
INI_WriteInt(handler,"Cash",0);
INI_WriteInt(handler,"Admin",0);
INI_WriteInt(handler,"Kills",0);
INI_WriteInt(handler,"Deaths",0);
INI_WriteInt(handler,"NoPm",0);
INI_WriteInt(handler,"Mute",0);
INI_WriteInt(handler,"Vip",0);
INI_WriteInt(handler,"C4",0);
INI_WriteInt(handler,"Banned",0);
INI_WriteInt(handler,"Cookies",0);
INI_WriteInt(handler,"Warn",0);
INI_WriteInt(handler, "RegisterDate_day", Day);
INI_WriteInt(handler, "RegisterDate_mon", Month);
INI_WriteInt(handler, "RegisterDate_year",Year);
INI_WriteInt(handler, "RegisterDate_hour",Hour);
INI_WriteInt(handler, "RegisterDate_min", Minute);
INI_WriteInt(handler, "RegisterDate_sec", Second);
INI_WriteInt(handler, "Min", 0);
INI_WriteInt(handler, "Hour", 0);
INI_WriteInt(handler, "Sec", 0);
INI_WriteInt(handler, "Jailed", 0);
INI_WriteInt(handler, "Logged", 0);
INI_WriteInt(handler, "AdminActions", 0);
INI_WriteInt(handler, "Rank", 0);
INI_Close(handler);
new string[128]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
return SendClientMessage(playerid, red, string);
}