SA-MP Forums Archive
When i type /createbiz Server Stopped - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: When i type /createbiz Server Stopped (/showthread.php?tid=608172)



When i type /createbiz Server Stopped - RedRex - 28.05.2016

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


Re: When i type /createbiz Server Stopped - andrejc999 - 28.05.2016

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


Re: When i type /createbiz Server Stopped - Unrea1 - 28.05.2016

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.


Re: When i type /createbiz Server Stopped - RedRex - 28.05.2016

Fixed Thanks


Re: When i type /createbiz Server Stopped - CodeStyle175 - 28.05.2016

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