PDA

View Full Version : Command Problem


San1
22/07/2013, 09:13 PM
No Errors - It Says The Business is Owned When its not even bought yet - Everything confirms its not bought - This command says its already bought - can sum1 plz help me ?
CMD:buybiz(playerid, params[])
{
for(new biz = 0; biz < MAX_BIZ; biz++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[biz][ex], BizInfo[biz][ey], BizInfo[biz][ez]))
{
if(PlayerInfo[playerid][BizID] == 0)
{
if(BizInfo[biz][Owned] == 1)
{
new string[128], string2[128], pname[MAX_PLAYER_NAME];
BizInfo[biz][Owned] = 1;
BizInfo[biz][Owner] = GetPlayerName(playerid, pname, sizeof(pname));
PlayerInfo[playerid][BizID] = biz;
format(string2, sizeof(string2), BPATH, biz);
INI_ParseFile(string2,"LoadBiz_%s", .bExtra = true, .extra = biz);
format(string, sizeof(string),"You Have Bought Business ID (%d)", biz);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You already own a business");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "This business is already Owned");
}
}
}
return 1;
}

IceCube!
22/07/2013, 09:18 PM
your reloading the file AFTER you alter a variable, either save before you reload (Which I will state isn't needed as in Reloading).

Quick Fix (Remove InI_PraseFile

San1
22/07/2013, 09:28 PM
Didnt work at all