24.01.2019, 19:14
When I type /biz plant or /biz edit near my business nothing happens.
Code:
COMMAND:biz(playerid, params[])
{
if (PlayerInfo[playerid][LoggedIn] == false) return true;
new string[128], param[64], amount, amount2;
if(sscanf(params, "s[64]I(-1)I(-1)", param, amount, amount2))
{
scm(playerid, COLOR_GREEN, "/biz [usage]");
scm(playerid, COLOR_GREY, " plant | edit | select |");
}
if(strcmp(param, "plant", true) == 0)
{
new allow = FurnRight(playerid, 1);
if(allow > 0) {
if(amount == (-1)) {
ShowModelSelectionMenuEx(playerid, FurnObjs, sizeof(FurnObjs), "Furniture List", 8, 16.0, 0.0, -55.0);
} else {
if(amount < 320 || amount > 35000) return scm(playerid, -1, "Invalid Object ID!");
if(GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0 && IsInvalidObjectID(amount)) return scm(playerid, -1, "This is not a valid outdoor furniture object!");
new foundid = -1;
for(new i = 0; i < MAX_OBJECT_ARRAY; i++) {
if(ObjectList[i][oID] == amount) {
foundid=i;
break;
}
}
if(foundid == -1) return scm(playerid, -1, "Invalid Object ID!");
new Float:X, Float:Y, Float:Z, obj = 0;
GetPlayerPos(playerid, X, Y, Z);
obj = CreatePlayerObject(playerid, amount, X+1.0, Y+1.0, Z, 0.0, 0.0, 0.0, 100.0);
SetPVarInt(playerid, "FurnObject", obj);
SetPVarInt(playerid, "EditorMode", 3);
SetPVarInt(playerid, "Mute", 1);
PlayerInfo[playerid][pFurnID]=amount;
EditPlayerObject(playerid, obj);
format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", ObjectList[foundid][oName]);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
else if(strcmp(param, "edit", true) == 0)
{
if(FurnRight(playerid, 1)){ GetCloseBizzObject(playerid, FurnRight(playerid, 1)); }
}
else if(strcmp(param, "removeall", true) == 0)
{
if(FurnRight(playerid, 1)) {
ShowPlayerDialog(playerid, DIALOG_BUSINESS_REMOVEALL, DIALOG_STYLE_MSGBOX, "Remove all furniture objects", "Are you sure you want to remove all of your current business furniture objects?", "Yes", "No");
} else SendClientMessage(playerid, COLOR_GREY, "You don't have permission to furnish this business.");
}
return 1;
}
stock FurnRight(playerid, type)
{
new key = -1;
if(type == 1)
{
for(new i = 0; i < sizeof(BusinessInfo); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 150.0,BusinessInfo[i][EnterX],BusinessInfo[i][EnterY],BusinessInfo[i][EnterZ]))
{
if(BusinessInfo[i][Type] == 1)
{
if(strlen(BusinessInfo[i][Owner]) > 0)
{
if(strcmp(BusinessInfo[i][Owner], PlayerInfo[playerid][Name], true) == 0)
{
key = i;
return key;
}
}
}
}
else if(IsPlayerInRangeOfPoint(playerid, 150.0,BusinessInfo[i][ExitX],BusinessInfo[i][ExitY],BusinessInfo[i][ExitZ]))
{
if(BusinessInfo[i][Type] == 0)
{
if(strlen(BusinessInfo[i][Owner]) > 0)
{
if(strcmp(BusinessInfo[i][Owner], PlayerInfo[playerid][Name], true) == 0)
{
key = i;
return key;
}
}
}
}
else if(IsPlayerInRangeOfPoint(playerid, 30.0,BusinessInfo[i][EnterX],BusinessInfo[i][EnterY],BusinessInfo[i][EnterZ]))
{
if(BusinessInfo[i][Type] == 0)
{
if(strlen(BusinessInfo[i][Owner]) > 0)
{
if(strcmp(BusinessInfo[i][Owner], PlayerInfo[playerid][Name], true) == 0)
{
key = i;
return key;
}
}
}
}
}
}
return -1;
}



but now I still get two messages showing?