buy command help
#1

Okay so basically im working on a biz system and im making a command to buy food...
I want it to be so that you can only use the command if your in a business but the problem now is that if your outside of ANY business type it will say unknown command, but if your in for instance a clothing shop it will give the proper error "You are not in a restaurant" when I go into a restaurant business and use the command it works fine...

Command:
pawn Код:
CMD:buyfood(playerid, params[])
{
    if(BizInfo[GetPVarInt(playerid,"InBiz")][bType] != 6)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not in a restaurant!");
        return 1;
    }
    ShowPlayerDialog(playerid, FOODMENU, DIALOG_STYLE_LIST, "Restaurant", "Sprunk       $15\nPizza      $30\nHamburger          $20\nChicken        $25", "Buy", "Cancel");
    return 1;
}
Reply
#2

anyone?
Reply
#3

Man you want if player example go enter in biz can do command and if he is not in biz can't do command?
Reply
#4

Okay, it says unknown command if the player is outside of ANY business but when a player is inside of any business it works as I want it to
Reply
#5

Instead of
PHP код:
if(BizInfo[GetPVarInt(playerid,"InBiz")][bType] != 6
- It should be
PHP код:
if (GetPVarInt(playerid"InBiz") > && if(BizInfo[GetPVarInt(playerid,"InBiz")][bType] != 6
Reply
#6

going to try it right now
Reply
#7

Nope.. did not fix it.
Reply
#8

My bad- This

PHP код:
if (GetPVarInt(playerid"InBiz") && BizInfo[GetPVarInt(playerid"InBiz")][bType] != 6
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)