04.03.2014, 19:25
ok it works ,but when i did it with some other commands it didn't work
pawn Код:
CMD:bnext(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 1)
{
SendClientMessageEx(playerid, COLOR_RED, "* Listing next available business...");
for(new i = 0; i < MAX_BUSINESS; i++)
{
if(BizInfo[i][bOwned] == 0 && BizInfo[i][bExteriorX] == 0.000000)
{
new string[128];
format(string, sizeof(string), "%d is available to use.", i);
SendClientMessageEx(playerid, COLOR_WHITE, string);
break;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
return 1;
}
return 1;
}
CMD:bnear(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 1)
{
SendClientMessageEx(playerid, COLOR_RED, "* Listing all free businesses within the server");
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i=0;i<MAX_BUSINESS;i++)
{
if(IsPlayerInRangeOfPoint(playerid, 1250, BizInfo[i][bExteriorX], BizInfo[i][bExteriorY], BizInfo[i][bExteriorZ]))
{
if(BizInfo[i][bOwned] == 0 && BizInfo[i][bExteriorX] == 0.000000)
{
new string[128];
format(string, sizeof(string), "Business ID: %d", i);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
}
return 1;
}
CMD:bname(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] <= 1339 && PlayerInfo[playerid][pShopTech] == 1)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
return 1;
}
new string[128], houseid, desc[24];
if(sscanf(params, "ds[128]", houseid, desc)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bname [business id] [name]");
format(BizInfo[houseid][bDescription], 128, "%s", desc);
format(string, sizeof(string), "You have set the business description to %s", desc);
SendClientMessageEx(playerid, COLOR_WHITE, string);
if(BizInfo[houseid][bOwned] == 0)
{
format(string, sizeof(string), "This business is\n for sale!\n Description: %s\nCost: $%d\n Level: %d\nType: %d\nID: %d\nTo buy this business type /buybusiness",BizInfo[houseid][bDescription],BizInfo[houseid][bValue],BizInfo[houseid][bLevel],BizInfo[houseid][bType],houseid);
UpdateDynamic3DTextLabelText(BizInfo[houseid][bTextID], COLOR_LIGHTBLUE, string);
}
else
{
format(string, sizeof(string), "This business is owned by\n %s\nDescription: %s\nLevel: %d\nType: %d\nID: %d",BizInfo[houseid][bOwner],BizInfo[houseid][bDescription],BizInfo[houseid][bLevel],BizInfo[houseid][bType],houseid);
UpdateDynamic3DTextLabelText(BizInfo[houseid][bTextID], COLOR_LIGHTBLUE, string);
}
format(string, sizeof(string), "%s has edited Business ID %d's description to %s.", GetPlayerNameEx(playerid), houseid, desc);
Log("logs/bedit.log", string);
return 1;
}