Difference between revisions of "LUA:AddPlayerMail"

 
(2 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
|Param4 = string
 
|Param4 = string
 
|Param4Desc = is the body of the mail
 
|Param4Desc = is the body of the mail
|Param5 = int8
+
|OptionalParam1 = int8
|Param5Desc = is the type of mail being sent
+
|OptionalParam1Desc = is the type of mail being sent
|Param6 = int32
+
|OptionalParam2 = int32
|Param6Desc = is the copper to send
+
|OptionalParam2Desc = is the copper to send
|Param7 = int32
+
|OptionalParam3 = int32
|Param7Desc = is the silver to send
+
|OptionalParam3Desc = is the silver to send
|Param8 = int32
+
|OptionalParam4 = int32
|Param8Desc = is the fold to send
+
|OptionalParam4Desc = is the fold to send
|Param9 = int32
+
|OptionalParam5 = int32
|Param9Desc = is the platinum to send
+
|OptionalParam5Desc = is the platinum to send
|Param10 = int32
+
|OptionalParam6 = int32
|Param10Desc = is the id of the item to send
+
|OptionalParam6Desc = is the id of the item to send
|Param11 = int16
+
|OptionalParam7 = int16
|Param11Desc = is the amount of the item to send
+
|OptionalParam7Desc = is the amount of the item to send
|Param12 = int32
+
|OptionalParam8 = int32
|Param12Desc = is the time the mail will expire
+
|OptionalParam8Desc = is the time the mail will expire
|Param13 = int32
+
|OptionalParam9 = int32
|Param13Desc = is the time the mail was sent
+
|OptionalParam9Desc = is the time the mail was sent
 
|Example =
 
|Example =
 
<pre>
 
<pre>
Line 44: Line 44:
 
'''expire time''' is in seconds for expiration, leave 0 for unlimited.
 
'''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
+
'''sent time'''  is in unix timestamp or left as 0 for default time of now
  
=== DOES NOT WORK ===
+
=== <span style="color:#ff0000"> DOES NOT WORK</span> ===
item id
 
  
stack size
+
'''''item id'''''
 +
 
 +
'''''stack size'''''
 
}}
 
}}

Latest revision as of 18:05, 11 February 2021


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