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=376393)



Help! - RyanPetersons - 10.09.2012

pawn Код:
new pname[MAX_PLAYER_NAME], path[200];
new file[200];
GetPlayerName(playerid, pname, sizeof(pname));
if(dini_Exists(inputtext)) return SendClientMessage(playerid, Red, "That name has already been taken!");
format(path, sizeof(path), "/myserver/%s.ini", pname);
dini_Set(path, "/myserver/%s.ini", inputtext);
SendClientMessage(playerid, Green, "Your name has been successfully been changed");
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);
Everything works in this, the business owner name saves also.
but, the our .ini file name does not saves.
Help with this pleaze, and find whats the mistake and then correct and then post it.
so it can work, pleaze do it faster as you can.


Re: Help! - RyanPetersons - 10.09.2012

Can anyone reply on this pleaze, sorry for bumping didn't noticed


Re: Help! - RyanPetersons - 10.09.2012

OMG, i didn't noticed, sorry for bumping alot.


Re: Help! - Audiophr3ak - 10.09.2012

You need to create the file before writing something into it. Use "dini_Create".


Re: Help! - RyanPetersons - 10.09.2012

I ain't writing something in it, I'm just changing the name of that file.


Re: Help! - Audiophr3ak - 10.09.2012

dini_Set is writing the string into the file, not changing it's name. You need to delete the old file and create a new one.


Re: Help! - RyanPetersons - 10.09.2012

Why the name of that file can't be changed?


Re: Help! - RyanPetersons - 10.09.2012

My variables are these
make me one changename cmd in dialogs by deleting the file and creating it again and setting the string
dini_Create(path);
dini_Set(path, "password", inputtext);
dini_IntSet(path, "moneys", GetPlayerMoney(playerid));
dini_IntSet(path, "adminlevel", pInfo[playerid][pAdminLevel] = 0);
dini_IntSet(path, "hours", pInfo[playerid][phours] = 0);
dini_IntSet(path, "bankid", pInfo[playerid][bankid] = 0);
dini_IntSet(path, "bankregistered", pInfo[playerid][bankregistered] = 0);
dini_IntSet(path, "minutes", pInfo[playerid][pminutes] = 0);
dini_IntSet(path, "rpteacher", pInfo[playerid][rpteacher] = 0);
dini_IntSet(path, "rpmarks", pInfo[playerid][rpmarks] = 0);
dini_IntSet(path, "passport1", pInfo[playerid][passport1] = 0);
dini_IntSet(path, "passport2", pInfo[playerid][passport2] = 0);
dini_IntSet(path, "passport3", pInfo[playerid][passport3] = 0);
dini_IntSet(path, "gps", pInfo[playerid][gps] = 0);
dini_IntSet(path, "job1", pInfo[playerid][job1] = 0);
dini_IntSet(path, "job2", pInfo[playerid][job2] = 0);
dini_IntSet(path, "job3", pInfo[playerid][job3] = 0);
dini_IntSet(path, "nzt", pInfo[playerid][nzt] = 0);
dini_IntSet(path, "cig", pInfo[playerid][cig] = 0);
dini_IntSet(path, "vehiclekeys", pInfo[playerid][vehiclekeys] = 0);
dini_IntSet(path, "cellphone", pInfo[playerid][cellphone] = 0);
dini_IntSet(path, "skin", GetPlayerSkin(playerid));

Foldername: myserver