Need a little hand in here
#1

How to make a command /setbiz. I tried many things but it fails. This is my /buybiz code

pawn Код:
if(strcmp(cmd, "/buybiz", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new Float:oldposx, Float:oldposy, Float:oldposz;
            GetPlayerName(playerid, playername, sizeof(playername));
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
            if(PlayerInfo[playerid][pPbiskey] != 255)
            {
                SendClientMessage(playerid, COLOR_WHITE, "   You already own a business, type /sellbiz if you want to buy this one.");
                return 1;
            }
            for(new b = 0; b < sizeof(SBizzInfo); b++)
            {
                if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
                {
                    if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
                    {
                        format(string, sizeof(string), "You Must Be Level %d To Purchase This",SBizzInfo[b][sbLevelNeeded]);
                        SendClientMessage(playerid, COLOR_GRAD5, string);
                        return 1;
                    }
                    if(GetPlayerPCash(playerid) >= SBizzInfo[b][sbBuyPrice])
                    {
                        PlayerInfo[playerid][pPbiskey] = b+100;
                        SBizzInfo[b][sbOwned] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
                        GivePlayerPCash(playerid,-SBizzInfo[b][sbBuyPrice]);
                        DestroyPickup(SBizzInfo[b][sbPickupID]);
                        SBizzInfo[b][sbPickupID]=CreateStreamPickup(1239, 1, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ],50);
                        SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On your New Purchase.");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
                        OnPropUpdate();
                        HouseEntered[playerid] = b;
                        OnPlayerDataSave(playerid);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
                        return 1;
                    }
                }
            }
            for(new b = 0; b < sizeof(BizzInfo); b++)
            {
                if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
                {
                    if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
                    {
                        format(string, sizeof(string), "You Must Be Level %d To Purchase This",BizzInfo[b][bLevelNeeded]);
                        SendClientMessage(playerid, COLOR_GRAD5, string);
                        return 1;
                    }
                    if(GetPlayerPCash(playerid) >= BizzInfo[b][bBuyPrice])
                    {
                        PlayerInfo[playerid][pPbiskey] = b;
                        BizzInfo[b][bOwned] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
                        GivePlayerPCash(playerid,-BizzInfo[b][bBuyPrice]);
                        //PlayerPlayMusic(playerid);
                        SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
                        PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
                        DestroyPickup(BizzInfo[b][bPickupID]);
                        BizzInfo[b][bPickupID]=CreateStreamPickup(1239, 1, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ],50);
                        SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
                        GameTextForPlayer(playerid, "~w~Welcome~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);
                        PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
                        PlayerInfo[playerid][pLocal] = b ;
                        SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On your New Purchase.");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
                        OnPropUpdate();
                        HouseEntered[playerid] = b;
                        OnPlayerDataSave(playerid);
                        SetPlayerVirtualWorld(playerid,b);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

We will need more information, such as errors, lines. etc, try not to post an entire script.
Reply
#3

no error. I told that how to make a /setbiz command from that /buybiz
Reply
#4

I still can't make it
Reply
#5

We will need more information, such as errors, lines. etc, try not to post an entire script.

We will need more information, such as errors, lines. etc, try not to post an entire script.

We will need more information, such as errors, lines. etc, try not to post an entire script.

We will need more information, such as errors, lines. etc, try not to post an entire script.
Reply
#6

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
We will need more information, such as errors, lines. etc, try not to post an entire script.

We will need more information, such as errors, lines. etc, try not to post an entire script.

We will need more information, such as errors, lines. etc, try not to post an entire script.

We will need more information, such as errors, lines. etc, try not to post an entire script.
OMG!! Are you a human? If so then, in my earlier post, I told that how to make a /setbiz command
Reply
#7

>such as errors

You NEED to tell us WHAT the problem is, don't just say "it doesn't work!!1" and start yelling at us because of your incompetence, we're TRYING to help you.
Reply
#8

This is a code request not help request. He wants a /setbiz command.
Reply
#9

Yes, but he said he "tried and failed," it's better to work off what he's already got so he has a chance to learn something.
Reply
#10

Can Anyone make /setbiz with the help of /buybiz?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)