pawn Код:
if(dialogid == 9999)
{
if(response == 1)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/myserver/%s.ini", pname);
dini_Set(path, "password", inputtext);
format(string,sizeof(string),"You've changed your password into %s",inputtext);
SendClientMessage(playerid,Yellow,string);
}
if(!response)
{
SendClientMessage(playerid,Yellow,"You choosed not to change the password");
}
}
if(dialogid == 9998)
{
if(response == 1)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/myserver/%s.ini", pname);
format(inputtext, sizeof(inputtext), "/myserver/%s.ini", inputtext);
dini_Remove(path);
dini_Create(inputtext);
dini_IntSet(inputtext, "adminlevel", pInfo[playerid][pAdminLevel] = 0);
dini_IntSet(inputtext, "hours", pInfo[playerid][phours] = 0);
dini_IntSet(inputtext, "minutes", pInfo[playerid][pminutes] = 0);
dini_IntSet(inputtext, "passport1", pInfo[playerid][passport1] = 0);
dini_IntSet(inputtext, "passport2", pInfo[playerid][passport2] = 0);
dini_IntSet(inputtext, "passport3", pInfo[playerid][passport3] = 0);
dini_IntSet(inputtext, "job1", pInfo[playerid][job1] = 0);
dini_IntSet(inputtext, "job2", pInfo[playerid][job2] = 0);
dini_IntSet(inputtext, "job3", pInfo[playerid][job3] = 0);
dini_IntSet(inputtext, "nzt", pInfo[playerid][nzt] = 0);
dini_IntSet(inputtext, "cig", pInfo[playerid][cig] = 0);
dini_IntSet(inputtext, "vehiclekeys", pInfo[playerid][vehiclekeys] = 0);
dini_IntSet(inputtext, "cellphone", pInfo[playerid][cellphone] = 0);
dini_IntSet(inputtext, "skin", GetPlayerSkin(playerid));
pInfo[playerid][sex] = dini_Int(path, "sex");
pInfo[playerid][age] = dini_Int(path, "age");
pInfo[playerid][phours] = dini_Int(path, "hours");
pInfo[playerid][pminutes] = dini_Int(path, "minutes");
pInfo[playerid][pAdminLevel] = dini_Int(path, "adminlevel");
pInfo[playerid][passport1] = dini_Int(path, "passport1");
pInfo[playerid][passport2] = dini_Int(path, "passport2");
pInfo[playerid][passport3] = dini_Int(path, "passport3");
pInfo[playerid][cellphone] = dini_Int(path, "cellphone");
pInfo[playerid][job1] = dini_Int(path, "job1");
pInfo[playerid][job2] = dini_Int(path, "job2");
pInfo[playerid][job3] = dini_Int(path, "job3");
pInfo[playerid][skin] = dini_Int(path, "skin");
pInfo[playerid][nzt] = dini_Int(path, "nzt");
pInfo[playerid][cig] = dini_Int(path, "cig");
pInfo[playerid][vehiclekeys] = dini_Int(path, "vehiclekeys");
pInfo[playerid][logged] = 1;
SetPlayerName(playerid,inputtext);
format(string,sizeof(string),"You've successfully changed your name into %s",inputtext);
SendClientMessage(playerid,Yellow,string);
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_INPUT,"Restoring Password","Type your password to save your password in this changing name info\n\n or Your account will not work","Accept","Exit");
}
if(!response)
{
SendClientMessage(playerid,Yellow,"You choosed not to change the name");
}
}
This is the dialog response, These two are the dialog's responses of /changename cmd, Can you pleaze fix this cmd
It has some bugs, and if you find any mistake in it, pleaze fix it.
1. You remove path before setting variables.
2. You not creating new file.