#1

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.
Reply
#2

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

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

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

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

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.
Reply
#7

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

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)