• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ new mail msg tfs 1.5 7.72

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
881
Solutions
7
Reaction score
122
Location
Brazil
YouTube
caruniawikibr
hello, I'm trying to edit a script where when the person receives a parcel, the other person who receives it will be notified that they received it in a green message, but I'm not able to make it work in creaturescripts


<event type="receivemail" name="Mail" script="mail.lua"/>


Lua:
function onReceiveMail(cid, sender, item, openBox)
    
if(openBox) then
        
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New mail has arrived.")
    
end

    
return true

end



1652488114760.png
 
hello, I'm trying to edit a script where when the person receives a parcel, the other person who receives it will be notified that they received it in a green message, but I'm not able to make it work in creaturescripts


<event type="receivemail" name="Mail" script="mail.lua"/>


Lua:
function onReceiveMail(cid, sender, item, openBox)
   
if(openBox) then
       
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New mail has arrived.")
   
end

   
return true

end



View attachment 67797

not a valid event type
 
Lua:
void Player::onReceiveMail() const
{
    if (isNearDepotBox()) {
        sendTextMessage(MESSAGE_INFO_DESCR, "New mail has arrived.");
    }
}

I noticed that the message only appears for those who are stepping on the depot Tile, I wanted it to appear regardless of where the player is
 
Last edited:
I noticed that the message only appears for those who are stepping on the depot Tile, I wanted it to appear regardless of where the player is
C++:
void Player::onReceiveMail() const
{
    sendTextMessage(MESSAGE_EVENT_ADVANCE, "New mail has arrived.");
}
 
Back
Top