SA-MP Forums Archive
Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help! (/showthread.php?tid=376748)



Help! - RyanPetersons - 11.09.2012

It works fine, everything saves, but the file saves at the wrong place.
pleaze, help me with this, fix this if you know that how to fix that?

pawn Код:
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/myserver/%s.ini", pname);
format(inputtext, sizeof(inputtext), "/myserver/%s.ini",pname);
if(dialogid == 22225)
{
    if(!response)
    {
    }
    else
    {
            dini_Remove(path);
            dini_Create(inputtext);
            dini_Set(inputtext,"password",inputtext);
            dini_IntSet(inputtext, "moneys", GetPlayerMoney(playerid));
            dini_IntSet(inputtext, "adminlevel", pInfo[playerid][pAdminLevel]);
            dini_IntSet(inputtext, "hours", pInfo[playerid][phours]);
            dini_IntSet(inputtext, "bankid", pInfo[playerid][bankid]);
            dini_IntSet(inputtext, "bankregistered", pInfo[playerid][bankregistered] = 0);
            dini_IntSet(inputtext, "minutes", pInfo[playerid][pminutes]);
            dini_IntSet(inputtext, "rpteacher", pInfo[playerid][rpteacher]);
            dini_IntSet(inputtext, "rpmarks", pInfo[playerid][rpmarks]);
            dini_IntSet(inputtext, "passport1", pInfo[playerid][passport1]);
            dini_IntSet(inputtext, "passport2", pInfo[playerid][passport2]);
            dini_IntSet(inputtext, "passport3", pInfo[playerid][passport3]);
            dini_IntSet(inputtext, "gps", pInfo[playerid][gps]);
            dini_IntSet(inputtext, "job1", pInfo[playerid][job1]);
            dini_IntSet(inputtext, "job2", pInfo[playerid][job2]);
            dini_IntSet(inputtext, "job3", pInfo[playerid][job3]);
            dini_IntSet(inputtext, "nzt", pInfo[playerid][nzt]);
            dini_IntSet(inputtext, "cig", pInfo[playerid][cig]);
            dini_IntSet(inputtext, "vehiclekeys", pInfo[playerid][vehiclekeys]);
            dini_IntSet(inputtext, "cellphone", pInfo[playerid][cellphone]);
            dini_IntSet(inputtext, "skin", GetPlayerSkin(playerid));
            pInfo[playerid][logged] = 1;
            format(string,sizeof(string),"You've successfully changed your name into %s, Change your password again",inputtext);
            SendClientMessage(playerid,Yellow,string);
            SetPlayerName(playerid,inputtext);
            format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
GetPlayerName(playerid,Name,sizeof(Name));
dini_Set(file, "Owner",inputtext);
format(Label, sizeof(Label), "Business Name: %s\nOwner: %s",dini_Get(file, "Name"),inputtext);
Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);

}
}



Re: Help! - Roach_ - 11.09.2012

Try this:
pawn Код:
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/myserver/%s.ini", pname);
if(dialogid == 22225)
{
    if(!response) return 0;
   
    dini_Remove(path);
    dini_Create(path);
    dini_Set(path,"password",inputtext);
    dini_IntSet(path, "moneys", GetPlayerMoney(playerid));
    dini_IntSet(path, "adminlevel", pInfo[playerid][pAdminLevel]);
    dini_IntSet(path, "hours", pInfo[playerid][phours]);
    dini_IntSet(path, "bankid", pInfo[playerid][bankid]);
    dini_IntSet(path, "bankregistered", pInfo[playerid][bankregistered] = 0);
    dini_IntSet(path, "minutes", pInfo[playerid][pminutes]);
    dini_IntSet(path, "rpteacher", pInfo[playerid][rpteacher]);
    dini_IntSet(path, "rpmarks", pInfo[playerid][rpmarks]);
    dini_IntSet(path, "passport1", pInfo[playerid][passport1]);
    dini_IntSet(path, "passport2", pInfo[playerid][passport2]);
    dini_IntSet(path, "passport3", pInfo[playerid][passport3]);
    dini_IntSet(path, "gps", pInfo[playerid][gps]);
    dini_IntSet(path, "job1", pInfo[playerid][job1]);
    dini_IntSet(path, "job2", pInfo[playerid][job2]);
    dini_IntSet(path, "job3", pInfo[playerid][job3]);
    dini_IntSet(path, "nzt", pInfo[playerid][nzt]);
    dini_IntSet(path, "cig", pInfo[playerid][cig]);
    dini_IntSet(path, "vehiclekeys", pInfo[playerid][vehiclekeys]);
    dini_IntSet(path, "cellphone", pInfo[playerid][cellphone]);
    dini_IntSet(path, "skin", GetPlayerSkin(playerid));
    pInfo[playerid][logged] = 1;
    format(string,sizeof(string),"You've successfully changed your name into %s, Change your password again", inputtext);
    SendClientMessage(playerid,Yellow,string);
    SetPlayerName(playerid,inputtext);
    format(file,sizeof(file),"Business/%i.ini",cpid[playerid]);
    GetPlayerName(playerid,Name,sizeof(Name));
    dini_Set(file, "Owner", inputtext);
    format(Label, sizeof(Label), "Business Name: %s\nOwner: %s",dini_Get(file, "Name"),inputtext);
    Update3DTextLabelText(BusinessInfo[cpid[playerid]][bLabel],White,Label);
}



Re: Help! - RyanPetersons - 11.09.2012

I want to save the file, if we add (path); at dini_Create function, then it will create the same path as the before name, i want to create the path with the new name, TRY TO UNDERSTAND!


Re: Help! - RyanPetersons - 11.09.2012

I fixed it myself, by making a stock, Thanks for your help which doesnt got success, well thanks.