function onSendMail(cid, receiver, item, openBox)
doWriteLogFile("data/logs/sentMailLog.txt", "[".. os.date('%d %B %y - %H:%M') .."] " .. cid .. " sent a parcel to " .. receiver .. " that weighted " .. getItemWeight(item.uid) .. ".")
end
function onSendMail(cid, receiver, item, openBox)
return doWriteLogFile("data/logs/sentMailLog.txt", "[".. os.date('%d %B %y - %H:%M') .."] " .. cid .. " sent a parcel to " .. receiver .. " that weighted " .. getItemWeight(item.uid) .. ".")
end
<channel id="10" name="Mail" active="no"/>
CHANNEL_MAIL = 10
function onSendMail(cid, receiver, item, openBox)
for _, pid in ipairs(getPlayersOnline()) do
doPlayerSendChannelMessage(pid, "", getCreatureName(cid) .. " sent a parcel to " .. getCreatureName(receiver) .. ", weight: " .. getItemWeight(item.uid), TALKTYPE_CHANNEL_Y, CHANNEL_MAIL)
end
return true
end
function onSendMail(cid, receiver, item, openBox)
if (doWriteLogFile("data/logs/sentMailLog.txt", "[".. os.date('%d %B %y - %H:%M') .."] " .. cid .. " sent a parcel to " .. receiver .. " that weighted " .. getItemWeight(item.uid) .. ".")) then
return true
else
print("Can't write log file.")
return false
end
return false
end
You don't need to return there because it'll return already.Code:function onSendMail(cid, receiver, item, openBox) if (doWriteLogFile("data/logs/sentMailLog.txt", "[".. os.date('%d %B %y - %H:%M') .."] " .. cid .. " sent a parcel to " .. receiver .. " that weighted " .. getItemWeight(item.uid) .. ".")) then return true else print("Can't write log file.") return false end [B][COLOR="Red"]return false[/COLOR][/B] end
xO!
You don't need to return there because it'll return already.
It's for special casesYou can write there return print("We shouldn't see this message
!") xD
We can use the two types:
print "a"
print("a")
All them'll work correctly