biz help
#1

Hi guys, I have a problem with this script, pretty much when I go into the game and I / createbiz the server crashes but when I do it in duty says you're not allowed to use this command so how could I do? this is the cmd:

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] = 0;
            
BizInfo[idx][bProducts] = 0;
            
BizInfo[idx][bSold] = 0;
            
BizInfo[idx][bLevel] = 1;
            
BizInfo[idx][bPrice] = 500000;
            
BizInfo[idx][bPickup] = CreateDynamicPickup(12721XYZ0);
            
format(stringsizeof(string), "[Business ID: %d]\nBusiness Type: %s\nBusiness Owner: %s\nStatus: For Sale\nPrice: $%d"idxRBT(idx), BizInfo[idx][bOwner], BizInfo[idx][bPrice]);
            
BizInfo[idx][bText] = CreateDynamic3DTextLabel(stringCOLOR_WHITEXYZ15);
            
format(stringsizeof(string), "{FF0000}[Admin Warn]{FF6347} %s has created business ID %d."RPN(playerid), idx);
            
//SendAdminMessage(COLOR_DARKRED, 1, string);
            
Log("logs/business.log"string);
            
idx MAX_BIZ;
        }
    }
    return 
1;

Reply


Messages In This Thread
biz help - by kevi11 - 17.03.2016, 11:20
Re: biz help - by VenusDarkX - 17.03.2016, 11:48
Re: biz help - by kevi11 - 17.03.2016, 12:24
Re: biz help - by Untonyst - 17.03.2016, 12:38
Re: biz help - by kevi11 - 17.03.2016, 13:21
Re: biz help - by Stev - 17.03.2016, 13:28
Re: biz help - by kevi11 - 17.03.2016, 13:29
Re: biz help - by introzen - 17.03.2016, 18:31
Re: biz help - by Konstantinos - 17.03.2016, 20:22

Forum Jump:


Users browsing this thread: 1 Guest(s)