Fast help [Please] 0ERRORS But help for this
#1

When i connected to my server and logging to RCON for creating biz i got this for all commands

Код:
You are not authorized to use this command.
PHP код:
CMD:createbiz(playeridparams[])
{
    new 
typestring[128];
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
if(sscanf(params"i"type))
    {
        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /createbiz [type]");
        
SendClientMessage(playeridCOLOR_GREY"TYPES: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club | 5) Advertisement Agency | 6) Fast Food | 7) Casino");
        return 
1;
    }
    if(
type || type 7) return SendClientMessage(playeridCOLOR_GREY"Businesses are between 1 and 7.");
    for(new 
idx=1idx<MAX_BIZidx++)
    {
        if(!
BizInfo[idx][bType])
        {
            
//g_bizRobber[idx] = -1;
            // Getting Business Setup
            
new Float:XFloat:YFloat:Z;
            
GetPlayerPos(playeridXYZ);
            
// Making Business
            
BizInfo[idx][bType] = type;
            
BizInfo[idx][bStatus] = 0;
            
format(BizInfo[idx][bOwner], 32"The State");
            
BizInfo[idx][bX] = X;
            
BizInfo[idx][bY] = Y;
            
BizInfo[idx][bZ] = Z;
            
BizInfo[idx][bMoney] = 1000;
            
BizInfo[idx][bProducts] = 0;
            
BizInfo[idx][bSold] = 0;
            
BizInfo[idx][bLevel] = 1;
            
BizInfo[idx][bPrice] = 99999999;
            if(
BizInfo[idx][bType] == 1)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12741XYZ0);
            }
            if(
BizInfo[idx][bType] == 2)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12751XYZ0);
            }
            if(
BizInfo[idx][bType] == 3)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12421XYZ0);
            }
            if(
BizInfo[idx][bType] == 4)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            }
            if(
BizInfo[idx][bType] == 5)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12391XYZ0);
            }
            if(
BizInfo[idx][bType] == 6)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            }
             if(
BizInfo[idx][bType] == 7)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            }
            
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"idxRBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
            
BizInfo[idx][bText] = CreateDynamic3DTextLabel(stringCOLOR_REDXYZ15);
            
format(stringsizeof(string), "AdmWarn: %s has created business ID %d."RPN(playerid), idx);
            
ABroadCast(COLOR_LIGHTREDstring2);
            
Log("logs/business.log"string);
            
idx MAX_BIZ;
            
SaveBiz();
        }
    }
    return 
1;

Reply
#2

You are checking if the player is admin to send the error message:

PHP код:
if(IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command."); 
Check if you aren't:

PHP код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command."); 
Reply
#3

Hello again Your code is worked But there is a problem

When i typed /createbiz 3 Server Restart Why? Can you help me ? I Check the server.log nothing there message for error or something
Reply
#4

send the full code of the biz
Reply
#5

Quote:
Originally Posted by Barnwell
Посмотреть сообщение
send the full code of the biz
Here you Go There Full Filtersciprt

PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <ZCMD>
#include <dini>
//#include <dudb>
//#include <dutils>
//#include <YSI/y_ini>
#include <streamer>
#include <sscanf2>
#include <foreach>
#pragma tabsize 0
#define FILTERSCRIPT
// Color Defines
#define COLOR_WHITE 0xFFFFFFFF
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_PM1 0xA65FC7FF
#define COLOR_PM2 0xD35FC7FF
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_OOC 0xE0FFFFFF
#define COLOR_GREY 0xAFAFAFFF
#define COLOR_LIGHTGREEN 0xADFF2FFF
#define COLOR_LIGHTRED 0xFF6347FF
#define COLOR_DARKRED 0xAA3333FF
#define COLOR_RED 0xFF0606FF
#define COLOR_LIGHTBLUE 0x33CCFFFF
#define COLOR_GREEN 0x33AA33FF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_PURPLE 0xC2A2DAFF
#define COLOR_ORANGE 0xFF9900FF
#define COLOR_REPORT 0xFFFF91FF
#define COLOR_RADIO 0x8D8DFFFF
#define COLOR_DEPTRADIO 0xFFD700FF
#define COLOR_BLUE 0x2641FEFF
#define COLOR_MEDIC 0xFF8282FF
#define COLOR_NEWBIE 0x7DAEFFFF
#define COLOR_LIME 0x00FF00FF
#define COLOR_NEWS 0x049C7100
#define COLOR_CYAN 0x01FCFFFF
#define COLOR_VIP 0xC93CCEFF
#define COLOR_GOLD 0xFFD700FF
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD6 0xF0F0F0FF
#define GetPlayerCash(%0) GetPVarInt(%0, "Cash")
// Biz Defines
#define MAX_BIZ 201
#define COE "{F07B0F}"
#define CWE "{FFFFFF}"
#define CGE "{2A8A07}"
#define INVALID_BIZ_ID 0
enum pInfo
{
    
pAdmin,
    
pCash,
    
pBiz,
    
pMaskOn,
    
pHideOn,
    
pTogReports,
    
pVBiz
};
new 
PlayerInfo[MAX_PLAYERS][pInfo];
new 
InsideMainMenu[MAX_PLAYERS];
new 
ActiveChatbox[MAX_PLAYERS];
enum bizInfo
{
    
bType,
    
bStatus,
    
bOwner[32],
    
bOwned,
    
Float:bX,
    
Float:bY,
    
Float:bZ,
    
bPickup,
    
bMoney,
    
bProducts,
    
Text3D:bText,
    
bSold,
    
bLevel,
    
bPrice,
    
bDescription[128],
    
bBizFee,
    
bAP
}
new 
BizInfo[MAX_BIZ][bizInfo];
public 
OnFilterScriptInit()
{
    
LoadBiz();
    print(
"\n--------------------------------------");
    print(
" -----Business Loaded------");
    print(
" -----Business Yassine(LOCS)------");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    
SaveBiz();
    return 
1;
}
stock CheckFiles()
{
    if(!
dini_Exists("biz.cfg")) dini_Create("biz.cfg");
    return 
1;
}
stock LoadBiz()
{
    if(!
fexist("biz.cfg")) fcreate("biz.cfg");
    new 
binfo[14][32];
    new 
string[256];
    new 
File:file fopen("biz.cfg"io_read);
    if(
file)
    {
        new 
idx 1;
        while(
idx MAX_BIZ)
        {
            
fread(filestring);
            
split(stringbinfo'|');
            
BizInfo[idx][bType] = strval(binfo[0]);
            
BizInfo[idx][bStatus] = strval(binfo[1]);
            
format(BizInfo[idx][bOwner], 32"%s"binfo[2]);
            
BizInfo[idx][bX] = floatstr(binfo[3]);
            
BizInfo[idx][bY] = floatstr(binfo[4]);
            
BizInfo[idx][bZ] = floatstr(binfo[5]);
            
BizInfo[idx][bMoney] = strval(binfo[6]);
            
BizInfo[idx][bProducts] = strval(binfo[7]);
            
BizInfo[idx][bSold] = strval(binfo[8]);
            
BizInfo[idx][bLevel] = strval(binfo[9]);
            
BizInfo[idx][bPrice] = strval(binfo[10]);
            
BizInfo[idx][bAP] = strval(binfo[11]);
            
BizInfo[idx][bPickup] = strval(binfo[12]);
            
BizInfo[idx][bOwned] = strval(binfo[13]);
            if(
BizInfo[idx][bType]) // If Business is owned
            
{
            
DestroyDynamicPickup(BizInfo[idx][bPickup]);
            if(
BizInfo[idx][bType] == 1)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12741BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 2)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12751BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 3)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12421BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 4)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12721BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 5)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12391BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 6)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
             if(
BizInfo[idx][bType] == 7)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], 0);
            }
                if(!
strcmp("The State"BizInfo[idx][bOwner])) format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"idxRBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
                
//else format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", idx, RBT(idx), BizInfo[idx][bOwner], RBS(idx));
                
else format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: %s"idxRBT(idx), BizInfo[idx][bOwner], RBS(idx));
                
BizInfo[idx][bText] = CreateDynamic3DTextLabel(stringCOLOR_WHITEBizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]+0.315);
            }
            
idx++;
        }
    }
    print(
"Businesses loaded successfully.");
    return 
1;
}
stock SaveBiz()
{
    if(!
fexist("biz.cfg")) fcreate("biz.cfg");
    new 
idx 1File:file;
    new 
string[256];
    while(
idx MAX_BIZ)
    {
        
format(stringsizeof(string), "%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d\r\n"BizInfo[idx][bType], BizInfo[idx][bStatus], BizInfo[idx][bOwner], BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ], BizInfo[idx][bMoney], BizInfo[idx][bProducts], BizInfo[idx][bSold], BizInfo[idx][bLevel], BizInfo[idx][bPrice], BizInfo[idx][bAP], BizInfo[idx][bPickup], BizInfo[idx][bOwned]);
        if(
idx == 1)
        {
            
file fopen("biz.cfg"io_write);
        }
        else
        {
            
file fopen("biz.cfg"io_append);
        }
        
fwrite(filestring);
        
fclose(file);
        
idx++;
    }
    print(
"Businesses saved successfully.");
}
CMD:createbizz(playeridparams[])
{
    new 
typestring[128];
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
if(sscanf(params"i"type))
    {
        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /createbizz [type]");
        
SendClientMessage(playeridCOLOR_GREY"TYPES: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club | 5) Advertisement Agency | 6) Fast Food | 7) Casino");
        return 
1;
    }
    if(
type || type 7) return SendClientMessage(playeridCOLOR_GREY"Businesses are between 1 and 7.");
    for(new 
idx=1idx<MAX_BIZidx++)
    {
        if(!
BizInfo[idx][bType])
        {
            
//g_bizRobber[idx] = -1;
            // Getting Business Setup
            
new Float:XFloat:YFloat:Z;
            
GetPlayerPos(playeridXYZ);
            
// Making Business
            
BizInfo[idx][bType] = type;
            
BizInfo[idx][bStatus] = 0;
            
format(BizInfo[idx][bOwner], 32"The State");
            
BizInfo[idx][bX] = X;
            
BizInfo[idx][bY] = Y;
            
BizInfo[idx][bZ] = Z;
            
BizInfo[idx][bMoney] = 1000;
            
BizInfo[idx][bProducts] = 0;
            
BizInfo[idx][bSold] = 0;
            
BizInfo[idx][bLevel] = 1;
            
BizInfo[idx][bPrice] = 99999999;
            if(
BizInfo[idx][bType] == 1)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12741XYZ0);
            }
            if(
BizInfo[idx][bType] == 2)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12751XYZ0);
            }
            if(
BizInfo[idx][bType] == 3)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12421XYZ0);
            }
            if(
BizInfo[idx][bType] == 4)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            }
            if(
BizInfo[idx][bType] == 5)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12391XYZ0);
            }
            if(
BizInfo[idx][bType] == 6)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            }
             if(
BizInfo[idx][bType] == 7)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            }
            
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"idxRBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
            
BizInfo[idx][bText] = CreateDynamic3DTextLabel(stringCOLOR_REDXYZ15);
            
format(stringsizeof(string), "AdmWarn: %s has created business ID %d."RPN(playerid), idx);
            
ABroadCast(COLOR_LIGHTREDstring2);
            
Log("logs/business.log"string);
            
idx MAX_BIZ;
            
SaveBiz();
        }
    }
    return 
1;
}
CMD:deletebiz(playeridparams[])
{
    new 
idstring[128];
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
if(sscanf(params"i"id)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /deletebiz [bizid]");
    if(!
BizInfo[id][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
    foreach(
Playeri)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][pBiz] == id)
        {
            
PlayerInfo[playerid][pBiz] = 0;
            
format(stringsizeof(string), " Adminstrator %s has deleted your business."RPN(playerid));
            
SendClientMessage(iCOLOR_WHITEstring);
        }
    }
    if(!
strcmp("The State"BizInfo[id][bOwner]))
    {
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted business ID %d."RPN(playerid), id);
    }
    else
    {
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has deleted %s's business. (ID %d)"RPN(playerid), BizInfo[id][bOwner], id);
    }
    
ABroadCast(COLOR_LIGHTREDstring2);
    
Log("logs/business.log"string);
    
BizInfo[id][bType] = 0;
    
BizInfo[id][bStatus] = 0;
    
format(BizInfo[id][bOwner], 32"");
    
BizInfo[id][bOwned]=0;
    
BizInfo[id][bX] = 0;
    
BizInfo[id][bY] = 0;
    
BizInfo[id][bZ] = 0;
    
BizInfo[id][bMoney] = 0;
    
BizInfo[id][bProducts] = 0;
    
DestroyDynamicPickup(BizInfo[id][bPickup]);
    
DestroyDynamic3DTextLabel(BizInfo[id][bText]);
    
SaveBiz();
    return 
1;
}
CMD:bizhelp(playeridparams[])
{
       if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    
SendClientMessage(playeridCOLOR_YELLOW"BUSINESS: {FFFFFF}/buybiz");
    if(
PlayerInfo[playerid][pBiz] || PlayerInfo[playerid][pVBiz]) SendClientMessage(playeridCOLOR_YELLOW"BUSINESS OWNER: {FFFFFF}/vault /lockb /buyproducts /sellbiztomarket");
    return 
1;
}
CMD:vault(playeridparams[])
{
    new 
valuestring[128];
    new 
idx PlayerInfo[playerid][pBiz];
       if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
PlayerInfo[playerid][pBiz] && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playeridCOLOR_GREY"You don't own a busines.");
    if(
GetPlayerVirtualWorld(playerid)-100 != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playeridCOLOR_GREY"You are not inside your business.");
    if(
GetPlayerVirtualWorld(playerid)-100 != idx && PlayerInfo[playerid][pVBiz])
    {
        
idx PlayerInfo[playerid][pVBiz];
        if(
GetPlayerVirtualWorld(playerid)-100 != idx) return SendClientMessage(playeridCOLOR_GREY"You are not inside your business.");
    }
    if(
sscanf(params"s[32]"params))
    {
        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /vault [option]");
        
SendClientMessage(playeridCOLOR_GREY"OPTIONS: withdraw | deposit");
        return 
1;
    }
    if(!
strcmp(params"withdraw"false8))
    {
        if(
sscanf(params"s[32]i"paramsvalue))
        {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /vault withdraw [amount]");
            
format(stringsizeof(string), "Current Vault Money: $%d"BizInfo[idx][bMoney]);
            
SendClientMessage(playeridCOLOR_GREYstring);
            return 
1;
        }
        if(
value BizInfo[idx][bMoney] || -value == BizInfo[idx][bMoney]) return SendClientMessage(playeridCOLOR_GREY"You don't have this much money in your business vault.");
        
BizInfo[idx][bMoney] -= value;
        
GivePlayerCash(playeridvalue);
        
format(stringsizeof(string), "* %s has withdrawn money from their business vault."RPN(playerid));
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
format(stringsizeof(string), " You have withdrawn $%d from your business vault, amount left: $%d"valueBizInfo[idx][bMoney]);
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    }
    else if(!
strcmp(params"deposit"false7))
    {
        if(
sscanf(params"s[32]i"paramsvalue))
        {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /vault deposit [amount]");
            
format(stringsizeof(string), "Current Vault Money: $%d"BizInfo[idx][bMoney]);
            
SendClientMessage(playeridCOLOR_GREYstring);
            return 
1;
        }
        if(
value PlayerInfo[playerid][pCash] && value GetPlayerCash(playerid)) return SendClientMessage(playeridCOLOR_GREY"You don't have this much money on you.");
        
BizInfo[idx][bMoney] += value;
        
GivePlayerCash(playerid, -value);
        
format(stringsizeof(string), "* %s has deposited money to their business vault."RPN(playerid));
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
        
format(stringsizeof(string), " You have deposited $%d to your business vault, current amount: $%d"valueBizInfo[idx][bMoney]);
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    }
    
SaveBiz();
    return 
1;
}
CMD:lockb(playeridparams[])
{
new 
string[128], lockdone;
    if(
PlayerInfo[playerid][pBiz] != INVALID_BIZ_ID)
    {
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
        {
            if(!
BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
            {
                
BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 1;
                
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\n{073303}%s{FFFFFF}\n%s\n%s\nEntrance: %d\n\nOwner: %s\n\n",PlayerInfo[playerid][pBiz], RBS(PlayerInfo[playerid][pBiz]),BizInfo[PlayerInfo[playerid][pBiz]][bDescription],RBT(PlayerInfo[playerid][pBiz]),BizInfo[PlayerInfo[playerid][pBiz]][bBizFee],BizInfo[PlayerInfo[playerid][pBiz]][bOwner]);
                
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITEstring);
                
format(stringsizeof(string), "* %s takes out their business keys and unlocks it."GetPlayerNameEx(playerid));
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
GameTextForPlayer(playerid"~g~Business Unlocked"35003);
            }
            else if(
BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
            {
                
BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
                
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\n{AA3333}%s{FFFFFF}\n%s\n%s\nEntrance: %d\n\nOwner: %s\n\n",PlayerInfo[playerid][pBiz], RBS(PlayerInfo[playerid][pBiz]),BizInfo[PlayerInfo[playerid][pBiz]][bDescription],RBT(PlayerInfo[playerid][pBiz]),BizInfo[PlayerInfo[playerid][pBiz]][bBizFee],BizInfo[PlayerInfo[playerid][pBiz]][bOwner]);
                
UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITEstring);
                
format(stringsizeof(string), "* %s takes out their business keys and locks it."GetPlayerNameEx(playerid));
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                
GameTextForPlayer(playerid"~r~Business Locked"35003);
            }
            
lockdone 1;
        }
         if(!
lockdone)
        {
            
SendClientMessage(playeridCOLOR_GREY"You are not near at your business");
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GRAD2"You either don't own a business");
        return 
1;
    }
    return 
1;
    }
CMD:buybiz(playeridparams[])
{
    new 
string[128], done;
       if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
       if(
PlayerInfo[playerid][pBiz] == 1) return SendClientMessage(playeridCOLOR_GREY"You already own a businesses.");
    
//if(PlayerInfo[playerid][pBiz] && PlayerInfo[playerid][pVIP] < 4) return SendClientMessage(playerid, COLOR_GREY, "You already own a business.");
    
for(new idx=1idx<MAX_BIZidx++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            if(!
strcmp("The State"BizInfo[idx][bOwner], false))
            {
                if(
GetPlayerMoney(playerid) < BizInfo[idx][bPrice]) return SendClientMessage(playeridCOLOR_GREY"You don't have enough money to buy this business.");
                {
                
GivePlayerCash(playerid, -BizInfo[idx][bPrice]);
                if(
PlayerInfo[playerid][pBiz]) PlayerInfo[playerid][pVBiz] = idx;
                else 
PlayerInfo[playerid][pBiz] = idx;
                
BizInfo[idx][bOwned] = 1;
                
format(BizInfo[idx][bOwner], 32"%s"RPNU(playerid));
                
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: {073303}%s{FFFFFF}"idxRBT(idx), BizInfo[idx][bOwner], RBS(idx));
                
UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITEstring);
                
SendClientMessage(playeridCOLOR_GREEN" You have successfully bought a business.");
                
SendClientMessage(playeridCOLOR_WHITE" Type /bizhelp to view your business commands.");
                
BizInfo[idx][bProducts] = 99999;
                
format(stringsizeof(string), "%s has bought business id %d."RPN(playerid), idx);
                
Log("logs/business.log"string);
                
idx MAX_BIZ;
                
done 1;
                
SaveBiz();
            }
            if(
idx == MAX_BIZ-&& !done)
            {
                
SendClientMessage(playeridCOLOR_GREY"This business is owned by someone else.");
            }
        }
        if(
idx == MAX_BIZ-&& !done)
        {
            
SendClientMessage(playeridCOLOR_GREY"You are not near a buyable business.");
        }
    }
}
    return 
1;
}
CMD:benter(playeridparams[])
{
    new 
string[128];
    for(new 
idx=1idx<MAX_BIZidx++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
              if(!
BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playeridCOLOR_GREY"This business is closed.");
            if(
BizInfo[idx][bType] == 1// 24/7 Business
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the shop."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid, -27.3025,-57.6649,1003.5469);
                
SetPlayerFacingAngle(playerid357.5915);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid6);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's 24/7 Market (( /buy )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
            else if(
BizInfo[idx][bType] == 2// Clothes Shop Business
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the shop."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid207.6832, -111.26681005.1328);
                
SetPlayerFacingAngle(playerid179.826400);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid15);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's Clothes Shop (( /buyclothes & /buytoys )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
            else if(
BizInfo[idx][bType] == 3// Ammunation Business
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the shop."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid287.0129, -107.88321001.5156);
                
SetPlayerFacingAngle(playerid76.7251);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid6);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's Ammunation (( /buyammo )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
            else if(
BizInfo[idx][bType] == 4// + Club Business
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the shop."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid493.6386,-24.7543,1000.6797);
                
SetPlayerFacingAngle(playerid183.4428);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid17);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's Club (( /list & /buy )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
            else if(
BizInfo[idx][bType] == 5// Advertisement Agency
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the shop."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid834.1631,7.4883,1004.1797);
                
SetPlayerFacingAngle(playerid86.7239);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid3);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's Advertisement Agency (( /ad )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
            else if(
BizInfo[idx][bType] == 6// Fast Food
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the shop."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid372.5915,-133.2247,1001.4922);
                
SetPlayerFacingAngle(playerid182.1137);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid5);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's Fast Food (( /list /buy )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
            else if(
BizInfo[idx][bType] == 7// Casino
            
{
                
format(stringsizeof(string), "* %s pushes the door and enters the casino."RPN(playerid));
                
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                
SetPlayerPos(playerid2233.8032,1712.2303,1011.7632);
                
SetPlayerFacingAngle(playerid0.4216);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerInterior(playerid1);
                
SetPlayerVirtualWorld(playerididx+100);
                
format(stringsizeof(string), "** Welcome to %s's Casino (( /list /buy )) **"BizInfo[idx][bOwner]);
                
SendClientMessage(playeridCOLOR_ORANGEstring);
                return 
1;
            }
        }
    }
    return 
1;
}
CMD:bexit(playeridparams[])
{
    new 
donestring[128];
    if(
IsPlayerInRangeOfPoint(playerid52233.8032,1712.2303,1011.7632) || IsPlayerInRangeOfPoint(playerid2, -27.3025,-57.6649,1003.5469) || IsPlayerInRangeOfPoint(playerid2207.6832, -111.26681005.1328) || IsPlayerInRangeOfPoint(playerid2287.0129, -107.88321001.5156) || IsPlayerInRangeOfPoint(playerid2493.6386,-24.7543,1000.6797) || IsPlayerInRangeOfPoint(playerid2834.1631,7.4883,1004.1797) || IsPlayerInRangeOfPoint(playerid2372.5915,-133.2247,1001.4922))
    {
        new 
idx;
        
idx GetPlayerVirtualWorld(playerid)-100;
        if(!
done && idx MAX_BIZ && BizInfo[idx][bType])
        {
            if(
BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ])
            {
                
idx GetPlayerVirtualWorld(playerid)-100;
                if(!
done && idx MAX_BIZ && BizInfo[idx][bType])
                {
                    
SetPlayerPos(playeridBizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]);
                    
SetPlayerInterior(playerid0);
                    
SetPlayerVirtualWorld(playerid0);
                }
                
done 1;
                return 
1;
            }
            
format(stringsizeof(string), "* %s pushes the door and exits the shop."RPN(playerid));
              if(
PlayerInfo[playerid][pMaskOn] == 1)
            {
                
format(stringsizeof(string), "* Stranger pushes the door and exits the shop.");
            }
            else
            {
                
format(stringsizeof(string), "* %s pushes the door and exits the shop."RPN(playerid));
            }
            
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
            
SetPlayerPos(playeridBizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]);
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
        }
        
done 1;
    }
    return 
1;
}
CMD:bused(playeridparams[])
{
    new 
string[128];
       if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
SendClientMessage(playeridCOLOR_ORANGE"[Used Businesses]:");
    for(new 
idx=1idx<MAX_BIZidx++)
    {
        if(
BizInfo[idx][bType])
        {
            
format(stringsizeof(string), "ID: %d | Type: %s | Level: %d | Price: $%d | Products: %d | Vault: $%d | Owner: %s"idxRBT(idx), BizInfo[idx][bLevel], BizInfo[idx][bPrice],BizInfo[idx][bProducts], BizInfo[idx][bMoney], BizInfo[idx][bOwner]);
            
SendClientMessage(playeridCOLOR_ORANGEstring);
        }
    }
    return 
1;
}
CMD:bedit(playeridparams[])
{
    new 
bizidstring[128], input;
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
if(sscanf(params"s[32]"params))
    {
        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit [option] [bizid]");
        
SendClientMessage(playeridCOLOR_GREY"OPTIONS: location | price | level | products | vault | entrancefee | truckers");
        return 
1;
    }
    if(!
strcmp(params"location"true8))
    {
        if(
sscanf(params"s[32]i"paramsbizid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit location [bizid]");
        new 
idx=bizid;
        if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
        
GetPlayerPos(playeridBizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ]);
        
DestroyDynamicPickup(BizInfo[bizid][bPickup]);
            if(
BizInfo[idx][bType] == 1)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12741BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 2)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12751BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 3)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12421BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 4)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12721BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 5)
            {
                 
BizInfo[idx][bPickup] = CreateDynamicPickup(12391BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
            if(
BizInfo[idx][bType] == 6)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
             if(
BizInfo[idx][bType] == 7)
            {
                
BizInfo[idx][bPickup] = CreateDynamicPickup(12721BizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ], 0);
            }
        
DestroyDynamic3DTextLabel(BizInfo[bizid][bText]);
        if(!
strcmp("The State"BizInfo[idx][bOwner])) format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"idxRBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
        else 
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: %s"idxRBT(idx), BizInfo[idx][bOwner], RBS(idx));
        
BizInfo[bizid][bText] = CreateDynamic3DTextLabel(stringCOLOR_WHITEBizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ]+0.315);
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has changed business ID %d's location."NORPN(playerid), bizid);
        
ABroadCast(COLOR_LIGHTREDstring2);
        
Log("logs/business.log"string);
    }
    else if(!
strcmp(params"price"true5))
    {
        if(
sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit price [bizid] [price]");
        if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
        if(
strcmp("The State"BizInfo[bizid][bOwner])) return SendClientMessage(playeridCOLOR_GREY"You can't edit the price of owned businesses.");
        
BizInfo[bizid][bPrice] = input;
        
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"bizidRBT(bizid), BizInfo[bizid][bOwner], BizInfo[bizid][bPrice]);
        
UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITEstring);
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set business ID %d's price to $%d."NORPN(playerid), bizidinput);
        
ABroadCast(COLOR_LIGHTREDstring2);
        
Log("logs/business.log"string);
    }
    else if(!
strcmp(params"level"true5))
    {
        
// L1: 0 | L2: 100 | L3: 300 | L4: 700 | L5: 1200
        
if(sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit level [bizid] [level]");
        if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
        if(
input || input 5) return SendClientMessage(playeridCOLOR_GREY"Levels are between 1 and 5.");
        
BizInfo[bizid][bLevel] = input;
        if(
input == 1BizInfo[bizid][bSold] = 0;
        if(
input == 2BizInfo[bizid][bSold] = 100;
        if(
input == 3BizInfo[bizid][bSold] = 300;
        if(
input == 4BizInfo[bizid][bSold] = 700;
        if(
input == 5BizInfo[bizid][bSold] = 1200;
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set business ID %d's level to %d."NORPN(playerid), bizidinput);
        
ABroadCast(COLOR_LIGHTREDstring2);
        
Log("logs/business.log"string);
    }
    else if(!
strcmp(params"products"true8))
    {
        if(
sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit products [bizid] [amount]");
        if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
        if(
input 0) return SendClientMessage(playeridCOLOR_GREY"Products can't be negative.");
        
BizInfo[bizid][bProducts] = input;
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set business ID %d's products to %d."NORPN(playerid), bizidinput);
        
ABroadCast(COLOR_LIGHTREDstring2);
        
Log("logs/business.log"string);
    }
    else if(!
strcmp(params"vault"true5))
    {
        if(
sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit vault [bizid] [amount]");
        if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
        if(
input 0) return SendClientMessage(playeridCOLOR_GREY"Vault money can't be negative.");
        
BizInfo[bizid][bMoney] = input;
        
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set business ID %d's vault money to $%d."NORPN(playerid), bizidinput);
        
ABroadCast(COLOR_LIGHTREDstring2);
        
Log("logs/business.log"string);
    }
    else if(!
strcmp(params"truckers"true8))
    {
           if(
sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit truckers [bizid] [type] (1=Accepting | 2=NotAccepting");
        if(!
BizInfo[bizid][bAP])
        {
            
BizInfo[bizid][bAP] = 1;
            
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set business ID %d to accept truckers."NORPN(playerid), bizid);
            
ABroadCast(COLOR_LIGHTREDstring2);
            
Log("logs/business.log"string);
        }
        else
        {
            
BizInfo[bizid][bAP] = 0;
            
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has set business ID %d to NOT accept truckers."NORPN(playerid), bizid);
            
ABroadCast(COLOR_LIGHTREDstring2);
            
Log("logs/business.log"string);
        }
    }
            else if(!
strcmp(params"entrancefee"false6))
            {
                if(
sscanf(params"s[32]ii"paramsbizidinput)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /bedit entrancefee [bizid] [amount]");
                if(
input 51 && input >= 20)
                {
                    
BizInfo[bizid][bBizFee] = input;
                    
format(stringsizeof(string), " You have set your entrance fee to $%d"input);
                    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                    
DestroyDynamic3DTextLabel(BizInfo[bizid][bText]);
                    
format(stringsizeof(string), "%s\n\n%s\n%s\nEntrance: %d\n\nOwner: %s\n\n ID: %d",RBS(bizid),BizInfo[bizid][bDescription],RBT(bizid),BizInfo[bizid][bBizFee],BizInfo[bizid][bOwner], bizid);
                    
BizInfo[bizid][bText] = CreateDynamic3DTextLabel(stringCOLOR_WHITEBizInfo[bizid][bX], BizInfo[bizid][bY], BizInfo[bizid][bZ]+0.33);
                    
UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITEstring);
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD1" You cannot set the biz fee higher than $50 or lower than $20");
                    return 
1;
                }
            }
    
SaveBiz();
    return 
1;
}
CMD:gotobiz(playeridparams[])
{
    new 
idxstring[128];
       if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
if(sscanf(params"i"idx)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /gotobiz [bizid]");
    if(!
BizInfo[idx][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
    
SetPlayerVirtualWorld(playerid0);
    
SetPlayerInterior(playerid0);
    
SetPlayerPos(playeridBizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]);
    
format(stringsizeof(string), " You have teleported to business ID %d."idx);
    
SendClientMessage(playeridCOLOR_WHITEstring);
    return 
1;
}
CMD:asellbiz(playeridparams[])
{
    new 
bizidstring[128];
       if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
IsPlayerAdmin(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an authorized to use this command.");
//    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
    
if(sscanf(params"i"bizid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /asellbiz [bizid]");
    if(!
BizInfo[bizid][bType]) return SendClientMessage(playeridCOLOR_GREY"Invalid business id.");
    if(!
strcmp("The State"BizInfo[bizid][bOwner], true)) return SendClientMessage(playeridCOLOR_GREY"This business is not owned by anybody.");
    foreach(
Playeri)
    {
        if(
IsPlayerConnected(i) && PlayerInfo[i][pBiz] == bizid)
        {
            
PlayerInfo[i][pBiz] = 0;
            
format(stringsizeof(string), " Administrator %s has sold your business."RPN(playerid));
            
SendClientMessage(iCOLOR_WHITEstring);
        }
    }
    
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has sold %s's business. (ID %d)"RPN(playerid), BizInfo[bizid][bOwner], bizid);
    
ABroadCast(COLOR_LIGHTREDstring2);
    
Log("logs/business.log"string);
    
BizInfo[bizid][bStatus] = 1;
    
format(BizInfo[bizid][bOwner], 32"The State");
    
format(stringsizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"bizidRBT(bizid), BizInfo[bizid][bOwner], BizInfo[bizid][bPrice]);
     
UpdateDynamic3DTextLabelText(BizInfo[bizid][bText], COLOR_WHITEstring);
     
SaveBiz();
    return 
1;
}
stock GivePlayerCash(playeridmoney)
{
    
SetPVarInt(playerid"Cash"GetPVarInt(playerid"Cash")+money);
    
GivePlayerMoney(playeridmoney);
    return 
1;
}
stock ABroadCast(color,string[],level)
{
    foreach(
Playeri)
    {
        if (
PlayerInfo[i][pAdmin] >= level && PlayerInfo[i][pTogReports] != 1)
        {
            
SendClientMessageEx(icolorstring);
            
//printf("%s", string);
        
}
    }
    return 
1;
}
stock SendClientMessageEx(playeridcolorstring[])
{
    if(
InsideMainMenu[playerid] == || ActiveChatbox[playerid] == 0)
        return 
0;
    else 
SendClientMessage(playeridcolorstring);
    return 
1;
}
stock fcreate(filename[])
{
    if (
fexist(filename)) return false;
    new 
File:fhnd;
    
fhnd=fopen(filename,io_write);
    if (
fhnd) {
        
fclose(fhnd);
        return 
true;
    }
    return 
false;
}
stock RBT(bizid)
{
    new 
string[24];
    if(!
BizInfo[bizid][bType]) format(stringsizeof(string), "None");
    else if(
BizInfo[bizid][bType] == 1format(stringsizeof(string), "24/7 Market");
    else if(
BizInfo[bizid][bType] == 2format(stringsizeof(string), "Clothes Shop");
    else if(
BizInfo[bizid][bType] == 3format(stringsizeof(string), "Ammunation");
    else if(
BizInfo[bizid][bType] == 4format(stringsizeof(string), "Club");
    
//else if(BizInfo[bizid][bType] == 5) format(string, sizeof(string), "Advertisement Agency");
    
else if(BizInfo[bizid][bType] == 5format(stringsizeof(string), "Adv. Agency");
    else if(
BizInfo[bizid][bType] == 6format(stringsizeof(string), "Fast Food");
    else if(
BizInfo[bizid][bType] == 7format(stringsizeof(string), "Casino");
    return 
string;
}
/*stock RHS(bizid)
{
    new string[16];
    if(!HouseInfo[bizid][hStatus]) format(string, sizeof(string), "{AA3333} Closed {FFFFFF}");
    else if(HouseInfo[bizid][hStatus]) format(string, sizeof(string), "{073303} Open {FFFFFF}");
    return string;
}*/
stock RBS(bizid)
{
    new 
string[16];
    if(!
BizInfo[bizid][bStatus]) format(stringsizeof(string), "Closed");
    else if(
BizInfo[bizid][bStatus]) format(stringsizeof(string), "Open");
    return 
string;
}
stock RPBP(playerid)
{
    new 
string[32];
    if(!
PlayerInfo[playerid][pBiz]) format(stringsizeof(string), "None");
    else if(
PlayerInfo[playerid][pBiz]) format(stringsizeof(string), "%d"BizInfo[PlayerInfo[playerid][pBiz]][bProducts]);
    return 
string;
}
stock RPN(playerid)
{
    new 
string[25];
    if(
PlayerInfo[playerid][pMaskOn] == 0)format(stringsizeof(string), "%s"RemoveUnderScore(playerid));
    else if(
PlayerInfo[playerid][pMaskOn] == 1)format(stringsizeof(string), "Stranger");
    return 
string;
}
stock Log(sz_fileName[], sz_input[]) {
    new    
sz_logEntry[156], i_dateTime[2][3], FilefileHandle fopen(sz_fileNameio_append);
    
gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
    
getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
    
format(sz_logEntrysizeof(sz_logEntry), "[%i/%i/%i - %i:%i:%i] %s\r\n"i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], sz_input);
    
fwrite(fileHandlesz_logEntry);
    return 
fclose(fileHandle);
}
stock SendNearbyMessage(playeridFloat:radiusstring[], col1col2col3col4col5)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    new 
Float:ixFloat:iyFloat:iz;
    new 
Float:cxFloat:cyFloat:cz;
    foreach(
Playeri)
    {
        if(
IsPlayerConnected(i))
        {
            if(
GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
            {
                
GetPlayerPos(iixiyiz);
                
cx = (ix);
                
cy = (iy);
                
cz = (iz);
                if(((
cx radius/16) && (cx > -radius/16)) && ((cy radius/16) && (cy > -radius/16)) && ((cz radius/16) && (cz > -radius/16)))
                {
                    
SendClientMessage(icol1string);
                }
                else if(((
cx radius/8) && (cx > -radius/8)) && ((cy radius/8) && (cy > -radius/8)) && ((cz radius/8) && (cz > -radius/8)))
                {
                    
SendClientMessage(icol2string);
                }
                else if(((
cx radius/4) && (cx > -radius/4)) && ((cy radius/4) && (cy > -radius/4)) && ((cz radius/4) && (cz > -radius/4)))
                {
                    
SendClientMessage(icol3string);
                }
                else if(((
cx radius/2) && (cx > -radius/2)) && ((cy radius/2) && (cy > -radius/2)) && ((cz radius/2) && (cz > -radius/2)))
                {
                    
SendClientMessage(icol4string);
                }
                else if(((
cx radius) && (cx > -radius)) && ((cy radius) && (cy > -radius)) && ((cz radius) && (cz > -radius)))
                {
                    
SendClientMessage(icol5string);
                }
            }
        }
    }
    return 
1;
}
stock RPNU(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    return 
name;
}
stock NORPN(playerid)
{
    new 
astring[25];
    if(
PlayerInfo[playerid][pHideOn] == 0)format(astringsizeof(astring), "%s"RemoveUnderScore(playerid));
    else if(
PlayerInfo[playerid][pHideOn] == 1)format(astringsizeof(astring), "Anon");
    return 
astring;
}
stock RemoveUnderScore(playerid)
{
    new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,name,sizeof(name));
    for(new 
0MAX_PLAYER_NAMEi++)
    {
        if(
name[i] == '_'name[i] = ' ';
    }
    return 
name;
}
stock split(const strsrc[], strdest[][], delimiter)
{
    new 
ili;
    new 
aNum;
    new 
len;
    while(
<= strlen(strsrc))
    {
        if(
strsrc[i] == delimiter || == strlen(strsrc))
        {
            
len strmid(strdest[aNum], strsrclii128);
            
strdest[aNum][len] = 0;
            
li i+1;
            
aNum++;
        }
        
i++;
    }
    return 
1;
}
ProxDetector(Floatf_Radiusplayeridstring[],col1,col2,col3,col4,col5)
{
    new
        
Floatf_playerPos[3];
    
GetPlayerPos(playeridf_playerPos[0], f_playerPos[1], f_playerPos[2]);
    foreach(
Playeri) {
      if(
GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid)) {
            if(
IsPlayerInRangeOfPoint(if_Radius 16f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol1string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radius 8f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol2string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radius 4f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol3string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radius 2f_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol4string);
            }
            else if(
IsPlayerInRangeOfPoint(if_Radiusf_playerPos[0], f_playerPos[1], f_playerPos[2])) {
                
SendClientMessage(icol5string);
            }
        }
    }
    return 
1;
}
stock GetPlayerNameEx(playerid)
{
    new
        
sz_playerName[MAX_PLAYER_NAME],
        
i_pos;
    
GetPlayerName(playeridsz_playerNameMAX_PLAYER_NAME);
    while ((
i_pos strfind(sz_playerName"_"falsei_pos)) != -1sz_playerName[i_pos] = ' ';
    return 
sz_playerName;

Reply
#6

Any help
Reply
#7

did this directory created on u scriptfiles ?

logs/business.log <-- the file include

else create a folder called log on ur scriptfiles folder and create a file called business.log
Reply
#8

WRONG
Reply
#9

Quote:
Originally Posted by Yaa
Посмотреть сообщение
did this directory created on u scriptfiles ?

logs/business.log <-- the file include

else create a folder called log on ur scriptfiles folder and create a file called business.log
bro, im already creating!!!..... i need help Please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)