21.11.2013, 07:42
Having some errors....
warning 215: expression has no effect
Line/code that causing the warning: PlayerInfo[playerid][pCash] -BizInfo[idx][bPrice];
The effect is .. no deduction on player money when he buys the biz
warning 215: expression has no effect
pawn Код:
CMD:buybiz(playerid, params[])
{
new string[128], done;
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVBiz] && PlayerInfo[playerid][pDonator] >= 3) return SendClientMessage(playerid, COLOR_GREY, "You already own two businesses.");
if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You already own a business.");
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
{
if(!strcmp("The State", BizInfo[idx][bOwner], false))
{
if(PlayerInfo[playerid][pCash] < BizInfo[idx][bPrice]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to buy this business.");
PlayerInfo[playerid][pCash] -BizInfo[idx][bPrice];
if(PlayerInfo[playerid][pBiz]) PlayerInfo[playerid][pVBiz] = idx;
else PlayerInfo[playerid][pBiz] = idx;
format(BizInfo[idx][bOwner], 32, "%s", RPNU(playerid));
format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a business.");
SendClientMessage(playerid, COLOR_WHITE, " Type /bizhelp to view your business commands.");
format(string, sizeof(string), "%s has bought business id %d.", RPN(playerid), idx);
Log("logs/business.log", string);
idx = MAX_BIZ;
done = 1;
}
if(idx == MAX_BIZ-1 && !done)
{
SendClientMessage(playerid, COLOR_GREY, "This business is owned by someone else.");
}
}
if(idx == MAX_BIZ-1 && !done)
{
SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable business.");
}
}
return 1;
}
The effect is .. no deduction on player money when he buys the biz