this is weird<.< now the file name is not showing up - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: this is weird<.< now the file name is not showing up (
/showthread.php?tid=165450)
this is weird<.< now the file name is not showing up -
Kar - 04.08.2010
idk wtf i did now it just shows configuration file and this inside
pawn Код:
Owner=KAR
Owned?=1
BizName=
Cost=100000
Sell=100000
wheres the bizname o.o?
pawn Код:
if(!strcmp(cmdtext, "/buybiz", true))
{
if(IsPlayerCloseEnoughToBis(playerid) == -1) return SendClientMessage(playerid, red, "You are not close enough to a business!");
{
new buss = IsPlayerCloseEnoughToBis(playerid);
if(BusinessInfo[buss][Disabled] == 1) return SendClientMessage(playerid, red, "Business is disabled!");
{
if(PlayerInfo[playerid][Money] < BusinessInfo[buss][BusCost]) return SendClientMessage(playerid, red, "You don't have enough money for this business =D");
{
if(!strcmp(BusinessInfo[buss][BusOwner], Playername(playerid), true))
{
new str[100]; //Creates a string
format(str, sizeof(str), "You have brought the business %s for $%d.", BusinessInfo[buss][BizName], BusinessInfo[buss][BusCost]); //Formats a string
SendClientMessage(playerid, green, str); //Sends the string
PlayerInfo[playerid][Money] -= BusinessInfo[buss][BusCost]; //Takes the $$ of for the business
BusinessInfo[BusinessCount][BizOwned] = 1;
BusinessInfo[BusinessCount][BusOwner] = Playername(playerid);
format(BusinessInfo[BusinessCount][BusOwner], MAX_PLAYER_NAME, "%s", Playername(playerid));
format(bfile,sizeof(bfile),bfile_path,BusinessInfo[BusinessCount][BizName]);
dini_Create(bfile);
dini_Set(bfile, "Owner", BusinessInfo[BusinessCount][BusOwner]);
dini_IntSet(bfile, "Owned?", BusinessInfo[BusinessCount][BizOwned]);
dini_Set(bfile, "BizName", BusinessInfo[BusinessCount][BizName]);
dini_IntSet(bfile, "Cost", BusinessInfo[BusinessCount][BusCost]);
dini_IntSet(bfile, "Sell", BusinessInfo[BusinessCount][BusSell]);
}
}
}
}
return 1;
}
Re: this is weird<.< now the file name is not showing up -
JaTochNietDan - 04.08.2010
It would appear that the variable that contains the BusinessName is empty. Also shouldn't this format
pawn Код:
format(bfile,sizeof(bfile),bfile_path,BusinessInfo[BusinessCount][BizName]);
Be
pawn Код:
format(bfile,sizeof(bfile),"%s%s.ini",bfile_path,BusinessInfo[BusinessCount][BizName]);
or
format(bfile,sizeof(bfile),"%s\%s.ini",bfile_path,BusinessInfo[BusinessCount][BizName]);
Depending on what bfile_path contains.
Because the way it is now doesn't make much sense
Re: this is weird<.< now the file name is not showing up -
Kar - 04.08.2010
pawn Код:
new bfile[128];
#define bfile_path "Businesses/%s.ini" // Where the pfile is stored, change this and it changes the hole script to it :)
okay actually it was
pawn Код:
format(bfile,sizeof(bfile),BusinessInfo[BusinessCount][BizName],bfile_path);
ty but
why aint the bizname showing?
dini_Set(bfile, "BizName", BusinessInfo[BusinessCount][BizName]);
cant use intset cus it would be a integar then..