• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Send item to depot GOD

gmstrikker

Well-Known Member
Joined
Jul 30, 2014
Messages
458
Solutions
1
Reaction score
50
I have a donate system...

Player show me the donate tell city and i give parcel to him with itemid 6527
(its donate coin)

But i have a problem to give items to dp Rookgaard (town id 7)
I put a DP on rookgaard and put on config.lua
Code:
mailboxDisabledTowns = "7"

And now when rookers donate what i need to do?

Im using 0.4
 
Hello,

I've been thinking about this whole concept, you should just get a decent Donation System that send items to player's backpack (there are a few on OTLand). Otherwise you'd have to write an extension to your mailbox.lua to not allow players with less access than your Gamemaster's access to send parcels to Rookgaard. I'm out of time right now, but I could help you once I'm home.
 
Hello,

I've been thinking about this whole concept, you should just get a decent Donation System that send items to player's backpack (there are a few on OTLand). Otherwise you'd have to write an extension to your mailbox.lua to not allow players with less access than your Gamemaster's access to send parcels to Rookgaard. I'm out of time right now, but I could help you once I'm home.

You really know how to do it?
 
You should instead get a script that sends the item to a players backpack like Okke already said. That way your donations would be automatical, you should be able to use that with gesior aac.
 
I haven't tested this, because.. reasons..
but couldn't we do something like this?
Code:
function onSendMail(cid, receiver, open, itemBox)
     if getPlayerGUIDByName(receiver) == nil then
         doPlayerSendCancel(cid, "This player does not exist.")
         return false
     end
     if getPlayerTown(receiver) == 7 and getPlayerAccess(cid) < 5 then
         doPlayerSendCancel(cid, "You cannot send mail to this town.")
         return false
     end
     return true
end

-- login.lua
-- registerCreatureEvent(cid, "parcelBlocked")

-- creaturescripts.xml
-- <event type="mailsend" name="parcelBlocked" event="script" value="parcelBlocked.lua"/>

Adjust player access to whatever 'god' is and get rid of the 'disable town id 7' from config.lua
But I think it should work?
 
I haven't tested this, because.. reasons..
but couldn't we do something like this?
Code:
function onSendMail(cid, receiver, open, itemBox)
     if getPlayerGUIDByName(receiver) == nil then
         doPlayerSendCancel(cid, "This player does not exist.")
         return false
     end
     if getPlayerTown(receiver) == 7 and getPlayerAccess(cid) < 5 then
         doPlayerSendCancel(cid, "You cannot send mail to this town.")
         return false
     end
     return true
end

-- login.lua
-- registerCreatureEvent(cid, "parcelBlocked")

-- creaturescripts.xml
-- <event type="mailsend" name="parcelBlocked" event="script" value="parcelBlocked.lua"/>

Adjust player access to whatever 'god' is and get rid of the 'disable town id 7' from config.lua
But I think it should work?


Ty, but not work
Code:
[9:37:58.115] [Error - CreatureEvent::configureEvent] No valid type for creature event.mailsend
[9:37:58.115] [Warning - BaseEvents::loadFromXml] Cannot configure an event
 
Ty guys...

But still a problem

When i throw parcel on mailbox show me this msg
This player does not exist.
(with correct name show me it)
And parcel's still send


---

If someone need this base (to 0.4) is:
Code:
<event type="sendmail" name="parcelBlocked" event="script" value="parcelBlocked.lua"/>

Code:
function onSendMail(cid, receiver, item, openBox)
  if getPlayerGUIDByName(receiver) == nil then
  doPlayerSendCancel(cid, "This player does not exist.")
  return false
  end
  if getPlayerTown(receiver) == 7 and getPlayerAccess(cid) < 6 then
  doPlayerSendCancel(cid, "You cannot send mail to this town.")
  return false
  end
  return true
end
 
Friday, Saturday, now Sunday.. and you haven't attempted to edit the script at all?
Put some prints in.
Show us your trying.
Give us screenshots.
Give us information.
Nobody here can or will help you, if you dont help us help you.
I only posted that script because everyone was crying 'source edit' when a function might already exist.
I have never tried using the function do I don't know what it returns.

What if you simply put 'return false'.. what happens to the parcel?
What information does each part of the function return?

Simple things to check.
Simple things to look into.

I don't mind helping people, but seriously, bump for 3 days, and n..

gotta go to work
rant over
 
Back
Top