SA-MP Forums Archive
[Help] Function and Command - 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: [Help] Function and Command (/showthread.php?tid=660940)



[Help] Function and Command - ApolloScripter - 17.11.2018

Okay, first of all, I use the southclaw GM and I'm adapting the same, on the server I developed a store, that by clicking on the buy button, the intention was for some function to check if the player has the necessary items in the inventory, then To check, I did this:

pawn Code:
new itemid;
    new tmp[5 + ITM_MAX_NAME + ITM_MAX_TEXT + 1];

    for(new i; i < GetPlayerInventorySize(playerid); i++)
    {
        itemid = GetInventorySlotItem(playerid, i);

        if(!IsValidItem(itemid))
            break;

        GetItemName(itemid, tmp);
    }
So, above it is probable that he takes the names of the items in the inventory of the player, i would like to know if has some command or function, that verifies if inside this item has a item "tal" for example:

In case of these items, contain the items: "potato" and "tomato" it will perform an action, otherwise it will perform another action.

these actions I know how it does, what I do not know is to do this check of the item, if anyone can help me, I will be very grateful, thanks in advance.


Re: [Help] Function and Command - ApolloScripter - 18.11.2018

Someone knew? Sorry the double post