I have been ninja'd already, but here was my solution, using the CLI's send function:
Code:
string message = "There you go!";
string [string] [int] GiveawayList;
file_to_map("TwinklyGiveaway_data.txt",GiveawayList);
string command;
string sendItemStr;
item sendItem;
foreach playername, numToSend in GiveawayList {
sendItemStr = GiveawayList[playername][numToSend] + " wad";
sendItem = sendItemStr.to_item();
if ( sendItem == $item[none] ) {
print("Item to be send to " + playername + " not recognized","red");
continue;
}
if ( item_amount(sendItem) < numToSend ) {
print("Not enough " + sendItemStr + "s to send to " + playername,"red");
continue;
}
command = "send " + numToSend.to_string() + " " + GiveawayList[playername][numToSend] + " wad to " + playername + " || " + message;
cli_execute(command);
}
You would need to have a file named TwinklyGiveaway_data.txt in Mafia's data folder formatted like this:
Code:
Guelerme 15 twinkly
Dricoleth 15 twinkly
Deatharte 15 twinkly
Hadanelith 1 prismatic
Rotund 15 twinkly
DrM94 15 twinkly
with tabs between entries.
You just need to modify the first line in the code to change the message people would get, and update TwinklyGiveaway_data.txt when you need.
This will only work with items that end in " wad".
Edit: regarding aqualectrix's question, you just need to add a second line with the same player name and a different kind of wad (either in Ninja's script, either in my datafile), to send more than one type of wads to the same person.