Hi,how I can send message for off-line players in game?
Like using the player key and if they log they will see the message and if he see the message then he cant see the same message again. Dont matter the date,if player takes 5 days to log he will get this message.
Jun 22 2016, 8:22 am
|
|
You'd have to store the message in some kind of file, indexed by the player's key in some way. Then when that player logs in you retrieve the data if it exists and display it, removing it when it gets displayed.
|
In response to Nadrew
|
|
like
var/messagefile/S = new("Savefiles/Message/[key].sav") something like this? |
You're thinking the right way, but you're not quite there, you don't even really need a savefile for this, a plain text file would probably be plenty. Take a look at the "text2file" and "file2text" procs, you'll also want to take a look at "fexists".
|
In response to Nadrew
|
|
I will take a look but it seems strange,how saves will save a message? :/
|
You don't need a savefile because the message is very basic text.
mob/admin/verb/LeaveMessage() I wrote this off the top of my head, don't expect it to compile it is purely an example. I didn't comment it because it's fairly self-explanatory. If you don't understand something there look it up. There's obviously stuff missing, like checking if the player is online when a message is left, and just sending it directly to them, but that should get you started. |
In response to Nadrew
|
|
Thanks for the help,It is working
|