04.08.2010, 23:01
idk wtf i did now it just shows configuration file and this inside
wheres the bizname o.o?
pawn Код:
Owner=KAR
Owned?=1
BizName=
Cost=100000
Sell=100000
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;
}