The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto loot self
Author Message
htid4life
Journeyman
*

Posts: 162
Likes Given: 27
Likes Received: 4 in 3 posts
Joined: Mar 2012
Reputation: 2



Post: #1
Auto loot self
hey guys i am trying to make this work so players can just Dclick there body and get there stuff back in there backpack..

Code:
[events e_auto_selfloot]
on=@death
Forcont <findlayer.21.uid> 0
  tag.contp=<contp>
endfor

ON=@itemdclick
if (<act.link>==<src.uid>) && (<act.type>==t_corpse)
  local.cycle=0
  ref1=<act.findcont.<local.cycle>.uid>
  for 0 <act.rescount>
    if !(<ref1.attr> & attr_move_never)
        ref1.bounce
        //ref1.cont = <src.findlayer.21.uid>
        If (<ref1.tag0.contp>)
          ref1.contp=<ref1.tag0.contp>
          ref1.tag.contp=
        endif
    else
        local.cycle += 1
    endif
    ref1=<act.findcont.<local.cycle>.uid>
  endfor
  src.sysmessage You take back all your belongings.
  src.findlayer.21.open
endif

but im having no luck with it..

[Image: htid.jpg]
08-02-2014 09:43 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Auto loot self
At first, I would move the @Death to @DeathCorpse, in some cases you may block the death but the items will get tagged anyways.

Second, I would use [typedef t_corpse] to override its default behaviour, since the @dclick in a corpse will fire less times than @ItemDClick which leads in less checks.
Having the corpse in mind... a Forcont (like you did in the @Death) can place the items back in your backpack.
08-02-2014 10:13 PM
Find all posts by this user Like Post Quote this message in a reply
htid4life
Journeyman
*

Posts: 162
Likes Given: 27
Likes Received: 4 in 3 posts
Joined: Mar 2012
Reputation: 2



Post: #3
RE: Auto loot self
ok thanks will attempt it now lol ty

[Image: htid.jpg]
08-02-2014 10:14 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #4
RE: Auto loot self
PHP Code:
[TYPEDEF T_CORPSE]
ON=@DCLICK
IF <LINK> == <SRC>
 IF <
RESCOUNT>
  
FORCONT <UID>
   
CONT <SRC>
  ENDFOR
 ENDIF
ENDIF 

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
08-03-2014 05:46 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)