Y_INI problem!! -
RLGaming - 23.10.2012
pawn Код:
if(dialogid == DIALOG_REGISTER)
{
if (!response) return Kick(playerid);
if(response)
{
new string[128], string2[128];
if(!strlen(inputtext)) return
format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
format(string2, sizeof(string2), "Error! Cannot create your account.\n\n%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
new INI:File = INI_Open(UserSavePath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 0);
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 0);
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills] = 0);
INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths] = 0);
INI_WriteInt(File, "Ban",PlayerInfo[playerid][pBan] = 0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have just registered, welcome to "GM_NAME"!");
SpawnPlayer(playerid);
}
}
It will create the file in the User folder, I get no errors or warnings, it creates it but theres no data inside it, any help?
Re: Y_INI problem!! -
newbienoob - 23.10.2012
INI_Close(File); ?
Re: Y_INI problem!! -
RLGaming - 23.10.2012
Still didn't fix it ;/
Re: Y_INI problem!! -
newbienoob - 23.10.2012
Hmm.. you don't need "PlayerInfo[playerid][****] = 0". Just remove PlayerInfo[playerid][*****] =
So it should be like
INI_WriteInt(File, "something",0);
Re: Y_INI problem!! -
RLGaming - 23.10.2012
Didnt work either :/
Re: Y_INI problem!! -
newbienoob - 23.10.2012
Try this.
PHP код:
if(dialogid == DIALOG_REGISTER)
{
if(!response) return Kick(playerid);
if(response)
{
new string[128], string2[128];
if(!strlen(inputtext))
{
format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
format(string2, sizeof(string2), "Error! Cannot create your account.\n\n%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
}
new INI:File = INI_Open(UserSavePath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File, "Level",0);
INI_WriteInt(File, "Admin",0);
INI_WriteInt(File, "Level",0);
INI_WriteInt(File, "Admin",0);
INI_WriteInt(File, "Kills",0);
INI_WriteInt(File, "Deaths",0);
INI_WriteInt(File, "Ban",0);
INI_Close(File);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have just registered, welcome to "GM_NAME"!");
SpawnPlayer(playerid);
}
}
If you still have a problem, show me your UserSavePath(playerid)
Re: Y_INI problem!! -
RLGaming - 23.10.2012
pawn Код:
stock UserSavePath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string), USERPATH, playername);
return string;
}
Still didn't work
Re: Y_INI problem!! -
_Khaled_ - 23.10.2012
look, this is direct from my server, it works.
PHP код:
new pname[MAX_PLAYER_NAME];
new string[256];
new string2[256];
new id;
new Float:health;
new WantedLevel = GetPlayerWantedLevel(playerid);
switch(dialogid)
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if (!response)
{
return 1;
}
if(response)
{
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash] +1000000);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player's Data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"AdminLevel",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Banned",0);
INI_Close(File);
}
}
}
switch(dialogid)
{
case DIALOG_LOGIN:
{
if (!response)
{
return 1;
}
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{F81414}","{FFFFFF}You have entered an incorrect password.\nPlease type your password below to login.\n\n{F81414}Please relog with a different username if that's not your account.","Login","Quit");
}
return 1;
}
}
}
Re: Y_INI problem!! -
RLGaming - 23.10.2012
^ Didnt work
IDK but yini or anything never saves on my computer but on my VPS it does, and thats like windows 2003 and mines windows 7
Re: Y_INI problem!! -
gtakillerIV - 23.10.2012
Run the server console as an Admin?
Or have Admin rights on your PC.