SphereCommunity
FORITEMS doesn´t work right? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: FORITEMS doesn´t work right? (/Thread-FORITEMS-doesn%C2%B4t-work-right)

Pages: 1 2


RE: FORITEMS doesn´t work right? - Vendetta - 07-07-2012 07:36 AM

i think best should be to use
foristance

then in 2 locals
local.distance
local.uid

foristance
if <local._for.distance> < <local.distance>>
local.distance = <local._for.distance>
local.uid = <local._for.uid>
endif
gouid <local.uid>

conceptualy should work
you could also use only a ref instead of local.uid but maybe it is a little bit more complex calculating everytime the distance, also should check for topobj to be equal with uid (on the ground...)

this should be a good idea Smile


RE: FORITEMS doesn´t work right? - admin phoenix - 07-11-2012 05:55 AM

ok my friends.
here is the script, if someone need and want it. thanks to all.

Code:
[FUNCTION f_death_to_shrine]
    ref1=<uid>    

FORITEMS 20
  IF ((<link> == <ref1.uid>) && (<type> == T_CORPSE))
    f_loot_death <ref1.uid>
    remove
  ENDIF
ENDFOR

    ref1.smsg @<def.def_smsg_info>,3 You will be teleported to the nex shrine
    local.lowdistance=50000
FORITEMS 6144
  IF (<type> == t_shrine)
   IF (<ref1.distance <uid>> < <local.lowdistance>)
     local.lowdistance= <ref1.distance <uid>>
     ref2 = <uid>
   ENDIF
  ENDIF
ENDFOR
    ref1.go = <ref2.p>
    ref1.update


[FUNCTION f_loot_death]
ref1=<args>
IF <findcont(0)>
    findcont(0).cont=<ref1>
    f_loot_death <ref1.uid>
   RETURN 1
  ELSE
    SRC.RESEND
    RETURN 1
ENDIF



RE: FORITEMS doesn´t work right? - Vendetta - 07-11-2012 06:31 AM

lol

it was best to use istances to avoid check for all map... however..


RE: FORITEMS doesn´t work right? - Extreme - 07-11-2012 09:29 AM

You're kidding me that you will use FORITEMS, right?
You will use lots of processing to find few items.
Really, I would use that I paste for your, its the fastest and don't need processing.
But OK.


RE: FORITEMS doesn´t work right? - admin phoenix - 07-11-2012 04:22 PM

hey folks . we have only 5-20 player online at the Same time . Do you think that this player will die at the Same time and the Script will be use 20 time at the same moment ?


RE: FORITEMS doesn´t work right? - Skul - 07-11-2012 10:51 PM

possible
Code:
.serv.allclients kill
lol