SphereCommunity
Areadef after dclick - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Areadef after dclick (/Thread-Areadef-after-dclick)

Pages: 1 2 3


RE: Areadef after dclick - kn4tseb - 07-01-2014 02:39 PM

ok, gonna c again

(07-01-2014 01:56 PM)Extreme Wrote:  
(07-01-2014 12:02 PM)kn4tseb Wrote:  i know feeh, but im under a function, and i dont know how to store src (who dclicked the item)
tag/ctag only?

[itemdef blah]
...

ON=@Dclick
F_bla // this will run the function on the dclicked item, not on people
src.F_bla // this will run in who dclicked the item

[Function F_bla]
ref1 = <src> // if you run the function on item, it should work and <src> = who dclicked
ref1 = <uid> // this is 'who' or 'what' you used the function

it wont work :/
Its logic, if you run the function on item, <uid> = item and maybe <src> = who dclicked
if you run the function on who dclicked <uid> = who dclicked

yes Extreme, i thought i could make a ref for both, i run the function on item, but couldnt make a reference for src so i had to make a tag/ctag/var
some triggers have some other ways to refer more than 1 obj, thats what i was trying to figure; but on this case i couldnt, i get <uid> = item dclicked (because i run the function under this one)
but <src> gets me a non define value or 0


RE: Areadef after dclick - Extreme - 07-02-2014 12:18 AM

bla <src>

[function bla]
ref1 <uid> // item
ref2 <args> // player


RE: Areadef after dclick - kn4tseb - 07-02-2014 04:59 AM

ohhhh i see Smile TY Extreme Wink


RE: Areadef after dclick - kn4tseb - 07-02-2014 10:29 AM

is it possible to store src on=@Timer when item is not contained without using a var/ctag/tag?


RE: Areadef after dclick - Extreme - 07-03-2014 02:02 AM

You can try use LINK.


RE: Areadef after dclick - kn4tseb - 07-03-2014 08:13 AM

i did, thanks...

i have a bit more complex issue...

i have this but the item is not created or equipped and after a while a get a console error,
ERROR:GC: 8 unplaced object deleted
ERROR:UID=040017400, id=046ee 'Item memory', Invalid code=3202 (Object not placed in the world)
ERROR:UID=04001740b, id=046ee 'Item memory', Invalid code=3202 (Object not placed in the world)
ERROR:UID=040017424, id=046ee 'Item memory', Invalid code=3202 (Object not placed in the world)
ERROR:UID=04001742e, id=046ee 'Item memory', Invalid code=3202 (Object not placed in the world)

this is the script:
PHP Code:
ON=@Timer
REF1 
<LINK>
REF2 <UID>
  IF (<
ref1.tag0.mytag> == 4)
    
FORCLIENTS 5 // <r3,5>
    
flags += 08
    SERV
.NEWITEM i_memitem   // <----- this item is not created or equipped :S dunno why:
        
NEW.ATTR 082
        EQUIP 
<NEW> 
    ENDFOR
  ENDIF
REF1.tag0.mytag =
ENDIF

[
itemdef i_memitem]
id=i_gold
name
=Item memory
type
=t_eq_script
LAYER
=LAYER_SPECIAL
TEVENTS
=t_equipitem

on
=@create
REGENHITS 
60
REGENSTAM 
15
REGENMANA 
20
Attr
=attr_invis|attr_decay

on
=@equiptest
IF (<src.findid.i_memitem>)
      
src.findid.i_memitem.remove
ENDIF

on=@Equip
// LINK = <src.uid>
SRC.SYSMESSAGE YOU HAVE EQUIPPED <NAME>
timer 1 

ok i noticed its not placed because of the TEVENTS=t_equipitem
but it's weird because i ve seen it working before Confused


RE: Areadef after dclick - Extreme - 07-03-2014 10:01 AM

ON=@Timer
REF1 <LINK> who is LINK?
REF2 <UID> who is UID?
IF (<ref1.tag0.mytag> == 4)
FORCLIENTS 5 // <r3,5>
REF10 <UID> // UID here is the 'client' being checked
REF10.flags |= 08 // += don't works in FLAGS/ATTR they are hexadecimal, you have to use |= to 'sum'
SERV.NEWITEM i_memitem // <----- this item is not created or equipped Confused dunno why:
NEW.ATTR 082
REF10.EQUIP <NEW>
ENDFOR
ENDIF
REF1.tag0.mytag =
ENDIF

Use the things I changed and answer my questions.


RE: Areadef after dclick - kn4tseb - 07-03-2014 10:27 AM

REF1 was <link>
and link was <src.uid>
ref2 is the item which time has ended
gonna change for what u wrote and retried it ^^

if i use |= to sum the hexadecimal values for flags, what's used for substractions? -=


RE: Areadef after dclick - Extreme - 07-03-2014 10:52 AM

&~

Did it works?


RE: Areadef after dclick - kn4tseb - 07-03-2014 11:01 AM

it fixed the sum values for hexadecimal but didnt work for the item, i tried remplacing the i_memitem for any other item like an ironplate arms and it works

the only way i can equip this i_memitem is without the TEVENTS Confused