Need Help ASAP please with my biz system.
#1

pawn Код:
CMD:bizedit(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 4)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command!");
        return 1;
    }

    new string[128], choice[32], bizid, amount, businesstype[128];
    if(sscanf(params, "s[32]dD", choice, bizid, amount))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /bizedit [name] [houseid] [(Optional)amount]");
        SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, Level, Type, Price");
        SendClientMessageEx(playerid, COLOR_GREY, "Available names: Prods, Locked");
        return 1;
    }

    if(strcmp(choice, "interior", true) == 0)
    {
        BizzInfo[bizid][bInteriorID] = GetPlayerInterior( playerid );
        GetPlayerPos( playerid, BizzInfo[bizid][bExitX], BizzInfo[bizid][bExitY], BizzInfo[bizid][bExitZ]);
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the interior!" );
        SaveBizz();

        format(string, sizeof(string), "%s has edited BizID %d's Interior.", GetPlayerNameEx(playerid), bizid);
        Log("logs/bedit.log", string);
        return 1;
    }
    else if(strcmp(choice, "exterior", true) == 0)
    {
        GetPlayerPos( playerid, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ]);
        SendClientMessageEx( playerid, COLOR_WHITE, "You have changed the exterior!" );
        DestroyDynamicPickup(BizzInfo[bizid][bPickupID]);
        //BizzInfo[bizid][bLocked] = 1;

        format(string, sizeof(string), "%s has edited BizID %d's Exterior.", GetPlayerNameEx(playerid), bizid);
        Log("logs/bedit.log", string);
        SaveBizz();
        if(BizzInfo[bizid][bOwned] == 0)
        {
            DestroyDynamic3DTextLabel(BizzInfo[bizid][bTextID]);
            BizzInfo[bizid][bPickupID] = CreateDynamicPickup(1274, 23, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ], 0, -1, -1, 150.0 );
            format(string, sizeof(string), "{0000FF}[Business]{F0CC00}\nOwner: %s\n%s\nEntrance Fee: $%d\nID: %d", BizzInfo[bizid][bOwner], BizzInfo[bizid][bMessage],BizzInfo[bizid][bEntranceCost], bizid);
            BizzInfo[bizid][bTextID] = CreateDynamic3DTextLabel(string, COLOR_DCHAT, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
            //Streamer_UpdateEx(playerid, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ]);
        }
        else
        {
            DestroyDynamic3DTextLabel(BizzInfo[bizid][bTextID]);
            BizzInfo[bizid][bPickupID] = CreateDynamicPickup(1274, 23, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ], 0, -1, -1, 150.0 );
            format(string, sizeof(string), "{0000FF}[%s For Sale]{F0CC00}\nPrice: $%d\nLevel: %d\nID: %d\nTo buy type /buybiz", businesstype,BizzInfo[bizid][bBuyPrice],BizzInfo[bizid][bLevelNeeded], bizid);
            BizzInfo[bizid][bTextID] = CreateDynamic3DTextLabel(string, COLOR_DCHAT, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
            //Streamer_UpdateEx(playerid, BizzInfo[bizid][bEntranceX], BizzInfo[bizid][bEntranceY], BizzInfo[bizid][bEntranceZ]);
        }
    }
    else if(strcmp(choice, "level", true) == 0)
    {
        BizzInfo[bizid][bLevelNeeded] = amount;
        format(string, sizeof(string), "You have set the house level to %d.", amount);
        SendClientMessageEx(playerid, COLOR_WHITE, string);
        if(BizzInfo[bizid][bOwned] == 0)
        {
            format(string, sizeof(string), "{0000FF}[%s For Sale]{F0CC00}\nPrice: $%d\nLevel: %d\nID: %d\nTo buy type /buybiz", businesstype,BizzInfo[bizid][bBuyPrice],BizzInfo[bizid][bLevelNeeded], bizid);
            UpdateDynamic3DTextLabelText(BizzInfo[bizid][bTextID], COLOR_DCHAT, string);
        }
        else
        {
            format(string, sizeof(string), "{0000FF}[Business]{F0CC00}\nOwner: %s\n%s\nEntrance Fee: $%d\nID: %d", BizzInfo[bizid][bOwner], BizzInfo[bizid][bMessage],BizzInfo[bizid][bEntranceCost], bizid);
            UpdateDynamic3DTextLabelText(BizzInfo[bizid][bTextID], COLOR_DCHAT, string);
        }
        format(string, sizeof(string), "%s has edited BizID %d's Level to %d.", GetPlayerNameEx(playerid), bizid, amount);
        Log("logs/bedit.log", string);
    }
    else if(strcmp(choice, "price", true) == 0)
    {
        BizzInfo[bizid][bBuyPrice] = amount;
        format(string, sizeof(string), "You have set the biz price to $%d.", amount );
        SendClientMessageEx(playerid, COLOR_WHITE, string);
        if(BizzInfo[bizid][bOwned] == 0)
        {
            format(string, sizeof(string), "{0000FF}[%s For Sale]{F0CC00}\nPrice: $%d\nLevel: %d\nID: %d\nTo buy type /buybiz", businesstype,BizzInfo[bizid][bBuyPrice],BizzInfo[bizid][bLevelNeeded], bizid);
            UpdateDynamic3DTextLabelText(BizzInfo[bizid][bTextID], COLOR_DCHAT, string);
        }

        format(string, sizeof(string), "%s has edited BizID %d's Price to $%d.", GetPlayerNameEx(playerid), amount);
        Log("logs/bedit.log", string);
    }
    else if(strcmp(choice, "type", true) == 0)
    {
        switch(amount)
        {
        case 1:
            {
                businesstype = "24-7";
                BizzInfo[bizid][bType] = 1;
            }
        case 2:
            {
                 businesstype = "Bank";
                 BizzInfo[bizid][bType] = 2;
            }
        case 3:
            {
                businesstype = "Club";
                BizzInfo[bizid][bType] = 3;
            }
        case 4:
            {
                businesstype = "Ammunation";
                BizzInfo[bizid][bType] = 4;
            }
        case 5:
            {
                businesstype = "Casino";
                BizzInfo[bizid][bType] = 5;
            }
        case 6:
            {
                businesstype = "Restaurant";
                BizzInfo[bizid][bType] = 6;
            }
        }
        if(BizzInfo[bizid][bOwned] ==0)
        {
            format(string, sizeof(string), "{0000FF}[%s For Sale]{F0CC00}\nPrice: $%d\nLevel: %d\nID: %d\nTo buy type /buybiz", businesstype,BizzInfo[bizid][bBuyPrice],BizzInfo[bizid][bLevelNeeded], bizid);
            UpdateDynamic3DTextLabelText(BizzInfo[bizid][bTextID], COLOR_DCHAT, string);
        }

        format(string, sizeof(string), "%s has edited BizID %d's Type to %d.", GetPlayerNameEx(playerid), bizid, amount);
        Log("logs/bedit.log", string);
    }
    SaveBizz();
    return 1;
}

It Simply just dont make the exterior (icon and owners ect. ect. really need this working asap, please help.
Reply
#2

Please please the code in between [pawn] tags.
Format:
[pawn]
ALL YOUR CODE
[./pawn] (Remove the '.')
Reply
#3

Done, sorry lol first post.

Anyone can use this, just i really need it working as its the last thing till my server is finished.... :/ lol
Reply
#4

its fixed thanks to EiresJason +2 rep, thank you so much.
Reply
#5

Np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)