LUA:AddPlayerMail
- Last edited 4 years ago by Vlash Nytefall
LUA:AllFunctions - AddPlayerMail
Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker
Adds mail to the players inbox
Syntax
AddPlayerMail(param1, param2, param3, param4, [opt param1], [opt param2], [opt param3], [opt param4], [opt param5], [opt param6], [opt param7], [opt param8], [opt param9])
Parameters
- Required - param1 (Spawn), param2 (string), param3 (string), param4 (string)
- param1 is the spawn getting the mail
- param2 is the person the mail is from
- param3 is the subject of the mail
- param4 is the body of the mail
- Optional - opt param1 (int8), opt param2 (int32), opt param3 (int32), opt param4 (int32), opt param5 (int32), opt param6 (int32), opt param7 (int16), opt param8 (int32), opt param9 (int32)
- opt param1 is the type of mail being sent
- opt param2 is the copper to send
- opt param3 is the silver to send
- opt param4 is the fold to send
- opt param5 is the platinum to send
- opt param6 is the id of the item to send
- opt param7 is the amount of the item to send
- opt param8 is the time the mail will expire
- opt param9 is the time the mail was sent
Example
function hailed(NPC, Spawn) AddPlayerMail(Spawn, "Neatz", "You Got Mail", "This buds for you!", 1, 2, 3, 4, 5, 420, 10, 0, 0) end
a NPC with this function will send the player mail from Neatz with a subject of You Got Mail and the mail saying This buds for you! in the form of spam. The player will also receive 2 copper, 3 silver, 4 gold, and 5 platinum along with the item associated with item id 420 and a 10 stack of that item. The mail will never expire and sets the sent time as the current time it was sent.
Notes
Mail Type
0 = Regular 1 = Spam 2 = GM
expire time is in seconds for expiration, leave 0 for unlimited.
sent time is in unix timestamp or left as 0 for default time of now
DOES NOT WORK
item id
stack size