SphereCommunity

Full Version: ON=@ITEMDROPON_GROUND
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I have problem with ON=@ITEMDROPON_GROUND trigger.
I need that for example someone drops item on the groud no matter where and this item dissapears after 20 seconds, can someone help me with that?
And when item is dropped on the ground it showes on the item Item will dissapear in 20 seconds.
Code:
on=@itemdropon_ground
if !( <act.attr> & attr_move_never ) && !( <act.attr> & attr_static )
  act.attr |= attr_decay
  act.p=<args>
  act.timer=20
  act.message This item will decay in 20 seconds.
  return 1
endif
(10-01-2012 10:28 PM)Skul Wrote: [ -> ]
Code:
on=@itemdropon_ground
if !( <act.attr> & attr_move_never ) && !( <act.attr> & attr_static )
  act.attr |= attr_decay
  act.p=<args>
  act.timer=20
  act.message This item will decay in 20 seconds.
  return 1
endif

Thanks mate. It worked. Smile
timer can cause some problems, since lot of script using @timer trigger. you can replace timer=20 line with argn1=200

http://wiki.sphere.torfo.org/index.php/@DropOn_Ground
If you use, timer or argn1 I think they don't check if it's static or move_never when the timer finish.
Code:
[Function f_item_decay]
ref1=<uid>
if !(<ref1.cont>) && !(<ref1.attr>&attr_static) && !(<ref1.attr>&attr_move_never) && !(<ref1.attr>&attr_owned)
ref1.remove
endif

In your player event;
Code:
On=@ItemDropOn_Ground
src.sysmessage This item will decay in 20 seconds.
act.timerf 20,f_item_decay

On=@ItemPickUp_Ground
act.timerf clear
Reference URL's