17.06.2018, 09:34
The mistake is in this line:
If player is not on biz icon to buy it, "i" will be -255 and there is no checking before the line I mentioned. So you need to move this line:
on top and be like this:
pawn Код:
if (strcmp(BizInfo[i][bOwner], pName(playerid), false) == 0) return SendClientMessage(playerid, 0xDC143CAA, "ERROR: You Already own this business");
pawn Код:
if(i == -255) return SendClientMessage(playerid,-1,"ERROR: You need to be on biz icon to bought it");
pawn Код:
new i = GetBizID(playerid);
if(i == -255) return SendClientMessage(playerid,-1,"ERROR: You need to be on biz icon to bought it");
if (strcmp(BizInfo[i][bOwner], pName(playerid), false) == 0) return SendClientMessage(playerid, 0xDC143CAA, "ERROR: You Already own this business");