When i try to edit business type it's not changing.
PHP код:
CMD:editbiz(playerid, params[])
{
new string[128],choice[32],biz,amount;
new opstring[64];
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
return 1;
}
if(sscanf(params, "s[32]dD", choice, biz, amount))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz [name]");
SendClientMessage(playerid, COLOR_GRAD1, "Available names: ID, Interior, Intmenu, Exterior, Price, Type, Name, Sellbiz, Reset, VW, Products");
return 1;
}
if(strcmp(choice,"Interior",true) == 0)
{
new interior = GetPlayerInterior(playerid);
new vw = 1000 + random(199999999999999999);
new Float:posx, Float:posy, Float:posz, Float:posa;
GetPlayerPos(playerid, posx, posy, posz);
GetPlayerFacingAngle(playerid, posa);
new Float:angle = posa + 180.0000;
BizInfo[biz][bIntLocationx] = posx;
BizInfo[biz][bIntLocationy] = posy;
BizInfo[biz][bIntLocationz] = posz;
BizInfo[biz][bInterior] = interior;
BizInfo[biz][bVirtualWorld] = vw;
BizInfo[biz][bExitAngle] = angle;
SetPlayerVirtualWorld(playerid, vw);
PlayerInfo[playerid][pVW] = vw;
PlayerInfo[playerid][pInBiz] = biz;
SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have changed this business interior.");
return 1;
}
else if(strcmp(choice,"intmenu",true) == 0)
{
ShowPlayerDialog(playerid, 9974,DIALOG_STYLE_LIST, "Business Interior Menu", "Bank\nCity Hall\nLSPD\nGym\nDrug House\nCrack Lab\n24/7\nAmmunation 1\nAmmunation 2\nAmmunation 3\nAmmunation 4\nAmmunation 5\nBinco\nDidier sachs\nProlaps\nSuburban\nVictim\nZip\nClub\nBar\nResturant\nPhone Company\nLottery", "Set Interior", "Cancel");
return 1;
}
else if(strcmp(choice,"Reset",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 99999)
{
SendClientMessage(playerid, COLOR_GREY, " Only for server owner !");
return 1;
}
BizInfo[biz][bLocation_x] = 0.0000;
BizInfo[biz][bLocation_y] = 0.0000;
BizInfo[biz][bLocation_z] = 0.0000;
BizInfo[biz][bInterior] = 0;
BizInfo[biz][bVirtualWorld] = 0;
BizInfo[biz][bExitAngle] = 0.0000;
BizInfo[biz][bEnterAngle] = 0.0000;
BizInfo[biz][bIntLocationx] = 0.0000;
BizInfo[biz][bIntLocationy] = 0.0000;
BizInfo[biz][bIntLocationz] = 0.0000;
strmid(BizInfo[biz][bOwner], "The State", 0, strlen("The State"), 255);
strmid(BizInfo[biz][bName], "None", 0, strlen("None"), 255);
BizInfo[biz][bLocked] = 0;
BizInfo[biz][bOwned] = 0;
BizInfo[biz][bType] = 0;
BizInfo[biz][bCameras] = 0;
BizInfo[biz][bTill] = 0;
BizInfo[biz][bFee] = 0;
DestroyDynamicMapIcon(BizIcon[biz]);
DestroyDynamicPickup(BizPickup[biz]);
DestroyDynamic3DTextLabel(BizLabel[biz]);
SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have reseted this business.");
return 1;
}
else if(strcmp(choice,"Exterior",true) == 0)
{
new pickup;
if(BizInfo[biz][bType] == 0) { pickup = 1239; }
else if(BizInfo[biz][bType] != 0) { pickup = 1272; }
new Float:posx, Float:posy, Float:posz, Float:posa;
GetPlayerPos(playerid, posx, posy, posz);
new interiorz = GetPlayerInterior(playerid);
new pvw = GetPlayerVirtualWorld(playerid);
GetPlayerFacingAngle(playerid, posa);
new Float:angle = posa + 180.0000;
BizInfo[biz][bLocation_x] = posx;
BizInfo[biz][bLocation_y] = posy;
BizInfo[biz][bLocation_z] = posz;
BizInfo[biz][bEnterAngle] = angle;
BizInfo[biz][bPInt] = interiorz;
BizInfo[biz][bPVW] = pvw;
DestroyDynamicPickup(BizPickup[biz]);
DestroyDynamic3DTextLabel(BizLabel[biz]);
BizPickup[biz] = CreateDynamicPickup(pickup, 1, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
SendClientMessage(playerid,COLOR_LIGHTBLUE, "You have changed this business entrance.");
if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] != 0)
{
new VString[255];
new price = BizInfo[biz][bPrice];
format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
DestroyDynamicMapIcon(BizIcon[biz]);
if(BizInfo[biz][bType] == 1)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
else if(BizInfo[biz][bType] == 2)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
else if(BizInfo[biz][bType] == 3)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
else if(BizInfo[biz][bType] == 4)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
else if(BizInfo[biz][bType] == 5)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
else if(BizInfo[biz][bType] == 6)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
else if(BizInfo[biz][bType] == 7)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
else if(BizInfo[biz][bType] == 8)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);
}
if(BizInfo[biz][bOwned] == 1 && BizInfo[biz][bType] != 0)
{
new VString[255];
new name[25], owner[MAX_PLAYER_NAME];
strmid(owner, BizInfo[biz][bOwner], 0, strlen(BizInfo[biz][bOwner]), 255);
strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
format(VString,sizeof(VString),"%s \nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[biz][bFee]);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
DestroyDynamicMapIcon(BizIcon[biz]);
if(BizInfo[biz][bType] == 1)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
else if(BizInfo[biz][bType] == 2)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
else if(BizInfo[biz][bType] == 3)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
else if(BizInfo[biz][bType] == 4)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
else if(BizInfo[biz][bType] == 5)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
else if(BizInfo[biz][bType] == 6)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
else if(BizInfo[biz][bType] == 7)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
else if(BizInfo[biz][bType] == 8)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);
}
if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] == 0)
{
new VString[255];
new name[25];
strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
format(VString,sizeof(VString),"%s", name);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
}
return 1;
}
else if(strcmp(choice,"Price",true) == 0)
{
new price = strvalEx(params);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Price [price]");
return 1;
}
if(BizInfo[biz][bOwned] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " The business is owned");
return 1;
}
if(BizInfo[biz][bType] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " The business is not buyable");
return 1;
}
if(price > 50000000 || price < 0)
{
SendClientMessage(playerid, COLOR_GREY, " The price must be between $1 - $50,000,000 !");
return 1;
}
BizInfo[biz][bPrice] = price;
DestroyDynamic3DTextLabel(BizLabel[biz]);
new VString[255];
format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
format(string, sizeof(string), "You have set this business price to %d.", price);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"Type",true) == 0)
{
new type;
if(!opstring[0])
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Type [ID] [0-8]");
SendClientMessage(playerid, COLOR_GREY, "Available types: 0 - Normal building | 1 - 24/7 | 2 - Club | 3 - Ammunation | 4 - Restaurant");
SendClientMessage(playerid, COLOR_GREY, "Available types: 5 - Clothing store | 6 - Phone company | 7 - Ad Company | 8 - Lottery");
return 1;
}
if(type < 0 || type > 8)
{
SendClientMessage(playerid, COLOR_GREY, " The biz type must be between 0 - 8 !");
return 1;
}
BizInfo[biz][bType] = type;
DestroyDynamic3DTextLabel(BizLabel[biz]);
DestroyDynamicPickup(BizPickup[biz]);
if(type == 0)
{
BizPickup[biz] = CreateDynamicPickup(1239, 1, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
}
else if(type != 0)
{
if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] != 0)
{
new VString[255];
new price = BizInfo[biz][bPrice];
format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
DestroyDynamicMapIcon(BizIcon[biz]);
if(BizInfo[biz][bType] == 1)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
else if(BizInfo[biz][bType] == 2)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
else if(BizInfo[biz][bType] == 3)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
else if(BizInfo[biz][bType] == 4)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
else if(BizInfo[biz][bType] == 5)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
else if(BizInfo[biz][bType] == 6)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
else if(BizInfo[biz][bType] == 7)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
else if(BizInfo[biz][bType] == 8)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);
}
if(BizInfo[biz][bOwned] == 1 && BizInfo[biz][bType] != 0)
{
new VString[255];
new name[25], owner[MAX_PLAYER_NAME];
strmid(owner, BizInfo[biz][bOwner], 0, strlen(BizInfo[biz][bOwner]), 255);
strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
format(VString,sizeof(VString),"%s \nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[biz][bFee]);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
DestroyDynamicMapIcon(BizIcon[biz]);
if(BizInfo[biz][bType] == 1)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 17, 0);
else if(BizInfo[biz][bType] == 2)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 49, 0);
else if(BizInfo[biz][bType] == 3)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 18, 0);
else if(BizInfo[biz][bType] == 4)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 50, 0);
else if(BizInfo[biz][bType] == 5)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 45, 0);
else if(BizInfo[biz][bType] == 6)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 25, 0);
else if(BizInfo[biz][bType] == 7)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 62, 0);
else if(BizInfo[biz][bType] == 8)
BizIcon[biz] = CreateDynamicMapIcon(BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], 36, 0);
}
if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] == 0)
{
new VString[255];
new name[25];
strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
format(VString,sizeof(VString),"%s", name);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
DestroyDynamicMapIcon(BizIcon[biz]);
}
BizPickup[biz] = CreateDynamicPickup(1272, 1, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z], BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
}
format(string, sizeof(string), "You have set this business type to %d.", type);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"ID",true) == 0)
{
new bid = strvalEx(params);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz ID [BizID]");
return 1;
}
if(bid < 0 || bid > 199)
{
SendClientMessage(playerid, COLOR_GREY, " The id must be between 0 - 199 !");
return 1;
}
BizEditID[playerid] = bid;
format(string, sizeof(string), "You are now editing the biz id %d.", bid);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"Name",true) == 0)
{
new idx;
new length = strlen(params);
while ((idx < length) && (params[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = params[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Name [Name]");
return 1;
}
if(InvalidChar(result) == 1)
{
SendClientMessage(playerid, COLOR_GREY, " ERROR: cannot contain invalid characters !");
return 1;
}
strmid(BizInfo[biz][bName], result, 0, strlen(result), 25);
DestroyDynamic3DTextLabel(BizLabel[biz]);
if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] != 0)
{
new VString[255];
new price = BizInfo[biz][bPrice];
format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
}
if(BizInfo[biz][bOwned] == 1 && BizInfo[biz][bType] != 0)
{
new VString[255];
new name[25], owner[MAX_PLAYER_NAME];
strmid(owner, BizInfo[biz][bOwner], 0, strlen(BizInfo[biz][bOwner]), 255);
strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
format(VString,sizeof(VString),"%s \nOwner: %s \nEntry fee: $%d", name,owner,BizInfo[biz][bFee]);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
}
if(BizInfo[biz][bOwned] == 0 && BizInfo[biz][bType] == 0)
{
new VString[255];
new name[25];
strmid(name, BizInfo[biz][bName], 0, strlen(BizInfo[biz][bName]), 255);
format(VString,sizeof(VString),"%s", name);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_GREEN, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
}
format(string, sizeof(string), "You have set this biz name to %s.", result);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"VW",true) == 0)
{
new vw = strvalEx(params);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz VW [VirtualWorld]");
return 1;
}
BizInfo[biz][bVirtualWorld] = vw;
format(string, sizeof(string), "You have set this biz virtual world to %d.", vw);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"Products",true) == 0)
{
new prod = strvalEx(params);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Products [amount]");
return 1;
}
BizInfo[biz][bProducts] = prod;
format(string, sizeof(string), "You have set this biz products to %d.", prod);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"Jackpot",true) == 0)
{
new jpot = strvalEx(params);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Jackpot [jackpot]");
return 1;
}
BizInfo[biz][bLottoJackpot] = jpot;
format(string, sizeof(string), "You have set this biz jackpot to %d.", jpot);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"LottoTime",true) == 0)
{
new ltime = strvalEx(params);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz LottoTime [0/1]");
return 1;
}
BizInfo[biz][bLottoTime] = ltime;
format(string, sizeof(string), "You have set this biz lotto time to %d.", ltime);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
else if(strcmp(choice,"Sellbiz",true) == 0)
{
new x_nr[32];
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /editbiz Sellbiz [confirm]");
SendClientMessage(playerid, COLOR_YELLOW,"Are you sure ? !");
return 1;
}
if(strcmp(x_nr,"confirm",true) == 0)
{
if(BizInfo[biz][bOwned] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, " This biz is not owned !");
return 1;
}
BizInfo[biz][bOwned] = 0;
BizInfo[biz][bLocked] = 0;
DestroyDynamic3DTextLabel(BizLabel[biz]);
strmid(BizInfo[biz][bOwner], "The State", 0, strlen("The State"), 255);
new VString[255];
new price = BizInfo[biz][bPrice];
format(VString,sizeof(VString),"Business for sale ! \nPrice: $%d \nType /buybiz to purchase it", price);
BizLabel[biz] = Text3D:CreateDynamic3DTextLabel(VString, COLOR_RED, BizInfo[biz][bLocation_x], BizInfo[biz][bLocation_y], BizInfo[biz][bLocation_z]+0.1, 20, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, BizInfo[biz][bPVW], BizInfo[biz][bPInt], -1, 100.0);
SendClientMessage(playerid,COLOR_YELLOW, "Biz sold !");
}
}
return 1;
}
And also, your optional parameter needs to have a default.
Note: why do you use sscanf and strtok at the same time? That's really unefficient and defeats the porpuse of sscanf. You have three parameters on the command for sscanf, and you only use two of them.