When i type /createbiz Server Stopped
#1

Hello Guys When i type /createbiz Server stopped i try to fix it but cant can u help me ?


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;

what happend ? Did this for im not make A Folder? At scirptfiles? there are biz.cfg i add its work when im create a biz
Reply
#2

Hm it's weird, I think that you should make a folder in scriptfiles by yourself and save/load into that folder...
Reply
#3

If you use a hosting, you must create the file "logs / business.log" and give permissions 777, preferably it is better text files (.txt)

Log ("logs / business.txt", string);

If not this, passes the function where the log "Log" and "SaveBiz" is created.
Reply
#4

Fixed Thanks
Reply
#5

add break function also at the end of the loop, because otherwise it'll add too many business
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)