You'd probably want to create an array to keep track of any offers, with an enumerator for an offer object. Something like this:
Code:
enum drugOffer {
offererID, // seller
offereeID, // potential buyer
//Possible some more data like drug type, amount, price
}
#define MAX_OFFERS 200 // at most, 200 offers can exist
new drugOffers[MAX_OFFERS][drugOffer]
Then, when you sell drugs to someone you create an offer by finding the nearest empty ID in the array and fill that with the correct data. You then inform the seller and the (potential) buyer of the offer and the ID it has, e.g. "Player Foo has offered to sell you drugs of type X for price Y. Use /buydrugs
id to accept.".
If the buyer decides to take the offer you can just use the ID to check the array if the offer indeed applies to the buyer (so the buyer cannot buy anyone's offer, just specific ones to him) and you can reset the values in the array to -1 to make it clear that the slot is empty.
Alternatively, if the buyer decides not to buy it, you could either make a /canceloffer function or wait for, say, 30 seconds before timing out the offer and resetting it.
If you want to sell to multiple people at the same time you could make it dependent on being near enough to the seller of the drugs, so your enum no longer contains an offereeID but instead you check if the buyer is near enough to the seller to buy the items.