26.08.2016, 09:36
Hi, I have a /products command in my script which you can change products' prices with. It used yo have dialog style list in this format "item - ($price)", but now I changed it to tablist headers and the problem is when I do /products and change the price of an item, it doesn't give me the name of the item because it is supposed to extract the item's name before "-", but I have now tablist headers and it doesn't have a "-" it's like that: "Item\tPrice\n\Cellphone\t%s\n\".
So basically all I need to know is how to get the item's name from there.
Here is the code:
As you can see I tried putting a space there, but it doesn't work. I need to get that "\t" there, but I don't know how. Does anyone know?
EDIT: Omg wrong section again wtf why do i always post here
So basically all I need to know is how to get the item's name from there.
Here is the code:
Код:
Dialog:EditProduct(playerid, response, listitem, inputtext[]) { static bizid = -1; if ((bizid = Business_Inside(playerid)) != -1 && Business_IsOwner(playerid, bizid)) { if (response) { static item[24]; strmid(item, inputtext, 0, strfind(inputtext, " ") - 1); // <-- here strpack(PlayerData[playerid][pEditingItem], item, 32 char); PlayerData[playerid][pProductModify] = listitem; Dialog_Show(playerid, PriceSet, DIALOG_STYLE_INPUT, "Business: Set Price", "Please enter the new product price for \"%s\":", "Modify", "Back", item); } } return 1; }
EDIT: Omg wrong section again wtf why do i always post here