Next day , It shows the name of the owner on the biz but owner cannot manage the biz
Код:
CMD:createbiz(playerid, params[])
{
new type, string[128];
if(PlayerInfo[playerid][pAdmin] < 100004) return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "i", type))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createbiz [type]");
SendClientMessage(playerid, COLOR_GREY, "TYPES: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club");
SendClientMessage(playerid, COLOR_GREY, "TYPES: | 5) Advertisement Agency | 6) Fast Food");
return 1;
}
if(type < 1 || type > 6) return SendClientMessage(playerid, COLOR_GREY, "Businesses are between 1 and 5.");
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(!BizInfo[idx][bType])
{
// Getting Business Setup
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
// Making Business
BizInfo[idx][bType] = type;
format(BizInfo[idx][bOwner], 32, "The State");
BizInfo[idx][bX] = X;
BizInfo[idx][bY] = Y;
BizInfo[idx][bZ] = Z;
BizInfo[idx][bMoney] = 0;
BizInfo[idx][bProducts] = 0;
BizInfo[idx][bSold] = 0;
BizInfo[idx][bLevel] = 1;
BizInfo[idx][bPrice] = 5000000;
BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 1;
BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, X, Y, Z, 0);
format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, RBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, X, Y, Z, 15);
format(string, sizeof(string), "AdmWarn: %s has created business ID %d.", RPN(playerid), idx);
ABroadCast(COLOR_DARKRED, string, 2 );
SaveBiz();
idx = MAX_BIZ;
}
}
return 1;
}