SA-MP Forums Archive
buy command help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: buy command help (/showthread.php?tid=446974)



buy command help - Nick_Phelps - 28.06.2013

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;
}



Re: buy command help - Nick_Phelps - 28.06.2013

anyone?


Re: buy command help - ScRipTeRi - 28.06.2013

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


Re: buy command help - Nick_Phelps - 28.06.2013

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


Re: buy command help - -CaRRoT - 28.06.2013

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



Re: buy command help - Nick_Phelps - 28.06.2013

going to try it right now


Re: buy command help - Nick_Phelps - 28.06.2013

Nope.. did not fix it.


Re: buy command help - -CaRRoT - 28.06.2013

My bad- This

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