05.02.2012, 21:19
You can use sscanf to create a command like this, it's pretty simple.
You would have alter it though on how you're doing your items, for example: If you're getting them from an inventory which is numbered then you might sell via the number, but if not then you'd use a string and just type in the name of whatever you are selling.
Obviously you'd have to define the 'Item', 'Amount' and 'Price' before the sscanf line, but that's it. Then you'd just implement the code for your items inside of it.
You would have alter it though on how you're doing your items, for example: If you're getting them from an inventory which is numbered then you might sell via the number, but if not then you'd use a string and just type in the name of whatever you are selling.
pawn Код:
if(sscanf(params, "sii", Item, Amount, Price)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sell [Item] [Amount] [Price]"); // Items via string