Hello Guys When i type /createbiz Server stopped i try to fix it but cant can u help me ?
PHP код:
CMD:createbiz(playerid, params[])
{
new type, string[128];
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_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(playerid, COLOR_WHITE, "USAGE: /createbiz [type]");
SendClientMessage(playerid, COLOR_GREY, "TYPES: 1) 24/7 | 2) Clothes Shop | 3) Ammunation | 4) Club | 5) Advertisement Agency | 6) Fast Food | 7) Casino");
return 1;
}
if(type < 1 || type > 7) return SendClientMessage(playerid, COLOR_GREY, "Businesses are between 1 and 7.");
for(new idx=1; idx<MAX_BIZ; idx++)
{
if(!BizInfo[idx][bType])
{
//g_bizRobber[idx] = -1;
// Getting Business Setup
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
// 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(1274, 1, X, Y, Z, 0);
}
if(BizInfo[idx][bType] == 2)
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1275, 1, X, Y, Z, 0);
}
if(BizInfo[idx][bType] == 3)
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1242, 1, X, Y, Z, 0);
}
if(BizInfo[idx][bType] == 4)
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, X, Y, Z, 0);
}
if(BizInfo[idx][bType] == 5)
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1239, 1, X, Y, Z, 0);
}
if(BizInfo[idx][bType] == 6)
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, X, Y, Z, 0);
}
if(BizInfo[idx][bType] == 7)
{
BizInfo[idx][bPickup] = CreateDynamicPickup(1272, 1, X, Y, Z, 0);
}
format(string, sizeof(string), "{FC2B6A}[Business ID: %d]{FFFFFF}\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d", idx, RBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
BizInfo[idx][bText] = CreateDynamic3DTextLabel(string, COLOR_RED, X, Y, Z, 15);
format(string, sizeof(string), "AdmWarn: %s has created business ID %d.", RPN(playerid), idx);
ABroadCast(COLOR_LIGHTRED, string, 2);
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
Hm it's weird, I think that you should make a folder in scriptfiles by yourself and save/load into that folder...
If you use a hosting, you must create the file "logs / business.log" and give permissions 777, preferably it is better text files (.txt)
If not this, passes the function where the log "Log" and "SaveBiz" is created.
add break function also at the end of the loop, because otherwise it'll add too many business