switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"San Andreas Border Partrol",""COL_RED"Incorrect Password, please try again.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit"); if(20 < strlen(inputtext) || strlen(inputtext) < 4 ) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"San Andreas Border Partrol",""COL_RED"Please choose a password between 4 and 20 characters.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit"); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"Player Data"); INI_WriteInt(File,"Password",udb_hash(inputtext)); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"CitySpawn",0); INI_WriteInt(File,"SpawnInHouse",0); INI_WriteInt(File,"Seconds",0); INI_WriteInt(File,"Minutes",0); INI_WriteInt(File,"Hours",0); INI_WriteInt(File,"Money",10000); INI_WriteInt(File,"BankCash",0); INI_WriteInt(File,"Score",0); INI_WriteInt(File,"Grams",0); INI_WriteInt(File,"Seeds",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_WriteInt(File,"Warnings",0); INI_WriteInt(File,"Skin",0); INI_WriteInt(File,"Team",0); INI_WriteInt(File,"TruckMCompleted",0); INI_WriteInt(File,"Wanted_Level",0); INI_WriteInt(File,"WeaponSlot1",0); INI_WriteInt(File,"WeaponSlot1_Ammo",0); INI_WriteInt(File,"WeaponSlot2",0); INI_WriteInt(File,"WeaponSlot2_Ammo",0); INI_WriteInt(File,"WeaponSlot3",0); INI_WriteInt(File,"WeaponSlot3_Ammo",0); INI_WriteInt(File,"WeaponSlot4",28); INI_WriteInt(File,"WeaponSlot4_Ammo",1000); INI_WriteInt(File,"WeaponSlot5",0); INI_WriteInt(File,"WeaponSlot5_Ammo",0); INI_WriteInt(File,"WeaponSlot6",0); INI_WriteInt(File,"WeaponSlot6_Ammo",0); INI_Close(File); Info[playerid][Logged] = true; TogglePlayerSpectating(playerid,0); SendClientMessage(playerid, COLOR_GREEN, "You have successfully registered. You can now choose your team."); SetTimerEx("GameTimeStats",1000,1,"i",playerid); } }
Tags cannot contain spaces.
Change "Player Data" to "Player_Data" |
Tags cannot contain spaces.
Change "Player Data" to "Player_Data" |
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(strlen(inputtext) < 4 || strlen(inputtext) > 20)
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, ""COL_WHITE"San Andreas Border Partrol",""COL_RED"Please choose a password between 4 and 20 characters.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
else if(strlen(inputtext) >= 4 && strlen(inputtext) < 21)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player Data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"CitySpawn",0);
INI_WriteInt(File,"SpawnInHouse",0);
INI_WriteInt(File,"Seconds",0);
INI_WriteInt(File,"Minutes",0);
INI_WriteInt(File,"Hours",0);
INI_WriteInt(File,"Money",10000);
INI_WriteInt(File,"BankCash",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Grams",0);
INI_WriteInt(File,"Seeds",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Warnings",0);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Team",0);
INI_WriteInt(File,"TruckMCompleted",0);
INI_WriteInt(File,"Wanted_Level",0);
INI_WriteInt(File,"WeaponSlot1",0);
INI_WriteInt(File,"WeaponSlot1_Ammo",0);
INI_WriteInt(File,"WeaponSlot2",0);
INI_WriteInt(File,"WeaponSlot2_Ammo",0);
INI_WriteInt(File,"WeaponSlot3",0);
INI_WriteInt(File,"WeaponSlot3_Ammo",0);
INI_WriteInt(File,"WeaponSlot4",28);
INI_WriteInt(File,"WeaponSlot4_Ammo",1000);
INI_WriteInt(File,"WeaponSlot5",0);
INI_WriteInt(File,"WeaponSlot5_Ammo",0);
INI_WriteInt(File,"WeaponSlot6",0);
INI_WriteInt(File,"WeaponSlot6_Ammo",0);
INI_Close(File);
Info[playerid][Logged] = true;
TogglePlayerSpectating(playerid,0);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully registered. You can now choose your team.");
SetTimerEx("GameTimeStats", 1000, 1, "i", playerid);
}
}
}
}
return true;
}
I work with ini file, and my tags have space, I assure him that what he said makes no sense.
Try this and check if you create the file, it could also be "userpath" the code you eh given should work. pawn Код:
|
It does make sense.
1. You use spaces while writing the field / tag names. 2. You don't save the players' stats in OnPlayerDisconnect (if you actually have a saving code there, check for spaces in your fields (INI_SetTag, INI_WriteInt, INI_WriteString, INI_WriteFloat) |
[Player Data] Password = 261948280 Admin = 0 CitySpawn = 0 SpawnInHouse = 0 Seconds = 0 Minutes = 0 Hours = 0 Money = 10000 BankCash = 0 Score = 0 Grams = 0 Seeds = 0 Kills = 0 Deaths = 0 Warnings = 0 Skin = 0 Team = 0 TruckMCompleted = 0 Wanted_Level = 0 WeaponSlot1 = 0 WeaponSlot1_Ammo = 0 WeaponSlot2 = 0 WeaponSlot2_Ammo = 0 WeaponSlot3 = 0 WeaponSlot3_Ammo = 0 WeaponSlot4 = 28 WeaponSlot4_Ammo = 1000 WeaponSlot5 = 0 WeaponSlot5_Ammo = 0 WeaponSlot6 = 0 WeaponSlot6_Ammo = 0 [Player_Data] Admin = 5 VIP = 0 CitySpawn = 0 SpawnInHouse = 0 Seconds = 20 Minutes = 1 Hours = 0 Money = 15000 BankCash = 0 Score = 0 Seeds = 5 Grams = 0 Kills = 0 Deaths = 0 Skin = 114 Team = 0 IP = ******************** TruckMCompleted = 0 LastVehicle = 0 Wanted_Level = 0 WeaponSlot1 = 0 WeaponSlot1_Ammo = 0 WeaponSlot2 = 0 WeaponSlot2_Ammo = 0 WeaponSlot3 = 0 WeaponSlot3_Ammo = 0 WeaponSlot4 = 0 WeaponSlot4_Ammo = 0 WeaponSlot5 = 0 WeaponSlot5_Ammo = 0 WeaponSlot6 = 0 WeaponSlot6_Ammo = 0