CMD:createbiz(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "Command not found on the server! /help");
new price, level, id, int, world, string[128], Float:Xi, Float:Yi, Float:Zi, inti;
if(sscanf(params,"ddi",price,level,id)) return SendClientMessage(playerid, COLOR_RED, "Make a business: /createbiz [Price] [Type] [ID]");
if(level < 0 || level > 8) return SendClientMessage(playerid, COLOR_RED, "Type can't be below than 0 or more than 8");
if(price < 100000) return SendClientMessage(playerid, COLOR_RED, "Price can't be below than $100,000");
new Float:x, Float:y, Float:z;
new Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
BusinessInfo[id][bOwned] = 0;
BusinessInfo[id][bPrice] = price;
BusinessInfo[id][bType] = level;
BusinessInfo[id][bEntranceX] = x;
BusinessInfo[id][bEntranceY] = y;
BusinessInfo[id][bEntranceZ] = z;
BusinessInfo[id][bEntranceA] = a;
if(level == 1) // 24/7
{
new rand = random(3);
if(rand == 1)
{
BusinessInfo[id][bExitX] = -25.9441;
BusinessInfo[id][bExitY] = -187.9824;
BusinessInfo[id][bExitZ] = 1003.5469;
BusinessInfo[id][bInsideInt] = 17;
BusinessInfo[id][bInsideWorld] = 2;
}
else if(rand == 2)
{
BusinessInfo[id][bExitX] = 6.0926;
BusinessInfo[id][bExitY] = -31.5992;
BusinessInfo[id][bExitZ] = 1003.5494;
BusinessInfo[id][bInsideInt] = 10;
BusinessInfo[id][bInsideWorld] = 2;
}
else if(rand == 3)
{
BusinessInfo[id][bExitX] = -30.9024;
BusinessInfo[id][bExitY] = -91.6607;
BusinessInfo[id][bExitZ] = 1003.5469;
BusinessInfo[id][bInsideInt] = 18;
BusinessInfo[id][bInsideWorld] = 2;
}
}
else if(level == 3) // Clothes
{
new rand = random(3);
if(rand == 1)
{
BusinessInfo[id][bExitX] = 207.7771;
BusinessInfo[id][bExitY] = -110.9639;
BusinessInfo[id][bExitZ] = 1005.1328;
BusinessInfo[id][bInsideInt] = 15;
BusinessInfo[id][bInsideWorld] = 2;
}
if(rand == 2)
{
BusinessInfo[id][bExitX] = 204.35222;
BusinessInfo[id][bExitY] = -168.7473;
BusinessInfo[id][bExitZ] = 1000.5234;
BusinessInfo[id][bInsideInt] = 14;
BusinessInfo[id][bInsideWorld] = 2;
}
if(rand == 3)
{
BusinessInfo[id][bExitX] = 207.0500;
BusinessInfo[id][bExitY] = -139.7851;
BusinessInfo[id][bExitZ] = 1003.5078;
BusinessInfo[id][bInsideInt] = 3;
BusinessInfo[id][bInsideWorld] = 2;
}
}
else if(level == 4) //pizza
{
BusinessInfo[id][bExitX] = 372.3002;
BusinessInfo[id][bExitY] = -132.9494;
BusinessInfo[id][bExitZ] = 1001.4922;
BusinessInfo[id][bInsideInt] = 5;
BusinessInfo[id][bInsideWorld] = 2;
}
else if(level == 5) //Burger
{
BusinessInfo[id][bExitX] = 363.3765;
BusinessInfo[id][bExitY] = -74.7553;
BusinessInfo[id][bExitZ] = 1001.5078;
BusinessInfo[id][bInsideInt] = 10;
BusinessInfo[id][bInsideWorld] = 2;
}
else if(level == 6) //Cluckin'bell
{
BusinessInfo[id][bExitX] = 364.8929;
BusinessInfo[id][bExitY] = -11.1855;
BusinessInfo[id][bExitZ] = 1001.8516;
BusinessInfo[id][bInsideInt] = 9;
BusinessInfo[id][bInsideWorld] = 2;
}
else if(level == 7) //Barber
{
BusinessInfo[id][bExitX] = 411.6246;
BusinessInfo[id][bExitY] = -22.8833;
BusinessInfo[id][bExitZ] = 1001.8047;
BusinessInfo[id][bInsideInt] = 2;
BusinessInfo[id][bInsideWorld] = 2;
}
else if(level == 8) //Tatoo
{
BusinessInfo[id][bExitX] = -204.4408;
BusinessInfo[id][bExitY] = -26.8013;
BusinessInfo[id][bExitZ] = 1002.2734;
BusinessInfo[id][bInsideInt] = 16;
BusinessInfo[id][bInsideWorld] = 2;
}
BusinessInfo[id][bOutSideIcon] = CreateDynamicPickup(1272,1,BusinessInfo[id][bEntranceX],BusinessInfo[id][bEntranceY],BusinessInfo[id][bEntranceZ],-1);
BusinessInfo[id][bInsideIcon] = CreateDynamicPickup(1272,1,BusinessInfo[id][bExitX],BusinessInfo[id][bExitY],BusinessInfo[id][bExitZ],-1);
new msg[128];
format(msg,sizeof(msg),"Next id will be %i !",id+1);
SendClientMessage(playerid, -1, msg);
new file4[40];
format(file4,sizeof(file4),BPATH, id);
new INI:File = INI_Open(file4);
INI_SetTag(File,"Data");
INI_WriteInt(File,"bOwned",BusinessInfo[id][bOwned]);
INI_WriteInt(File,"bPrice",BusinessInfo[id][bPrice]);
INI_WriteString(File,"bOwner",BusinessInfo[id][bOwner]);
INI_WriteInt(File,"bType",BusinessInfo[id][bType]);
INI_WriteInt(File,"bLocked",BusinessInfo[id][bLocked]);
INI_WriteInt(File,"bMoney",BusinessInfo[id][bMoney]);
INI_WriteFloat(File,"bEntranceX",BusinessInfo[id][bEntranceX]);
INI_WriteFloat(File,"bEntranceY",BusinessInfo[id][bEntranceY]);
INI_WriteFloat(File,"bEntranceZ",BusinessInfo[id][bEntranceZ]);
INI_WriteFloat(File,"bEntranceA",BusinessInfo[id][bEntranceA]);
INI_WriteFloat(File,"bExitX",BusinessInfo[id][bExitX]);
INI_WriteFloat(File,"bExitY",BusinessInfo[id][bExitY]);
INI_WriteFloat(File,"bExitZ",BusinessInfo[id][bExitZ]);
INI_WriteFloat(File,"bExitA",BusinessInfo[id][bExitA]);
INI_WriteInt(File,"bInt",BusinessInfo[id][bInt]);
INI_WriteInt(File,"bWorld",BusinessInfo[id][bWorld]);
INI_WriteInt(File,"bInsideInt",BusinessInfo[id][bInsideInt]);
INI_WriteInt(File,"bInsideWorld",BusinessInfo[id][bInsideWorld]);
INI_WriteInt(File,"bInsideIcon",BusinessInfo[id][bInsideIcon]);
INI_WriteInt(File,"bOutSideIcon",BusinessInfo[id][bOutSideIcon]);
INI_WriteString(File,"bName","None");
INI_Close(File);
biz++;
SaveBusiness(id);
return 1;
}
return 1;
I'm not sure, but return in ZCMD should always contain 1. You use like return SendClientMessage.... Maybe try sending a message and then return 1.
|
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "Command not found on the server! /help");
if(PlayerInfo[playerid][pAdmin] < 5) return 0;