SphereCommunity
Jailing - Printable Version

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



Jailing - Llirik - 08-05-2016 09:42 PM

Hi, guys! I'm need EQUIP item on target char!

[FUNCTION legend_jail]
targetf f_legend_jail

[FUNCTION f_legend_jail]
if !<argo.isplayer>
src.sysmessage Isn't player!
return 1
endif
if <argo.account.jail>
src.sysmessage [jailed]
else
argo.events +e_legendjail
argo.jail
argo.tag0.bail=1
argo.tag0.bailcost=100000
argo.tag0.jailtime=24*60*60
argo.tag0.reason=rules
serv.newitem m_jail_clocker
new.cont=<argo.uid> // this is right? Item 'm_jail_clocker' on TARGET char?
endif

[ITEMDEF m_jail_clocker]
TYPE=t_eq_script

ON=@Create
timer 1

ON=@Timer
cont.tag0.jailtime -= 1
if (<cont.tag0.jailtime> <= 0)
cont.events -e_legendjail
cont.kills=0
cont.forgive
cont.go Britain
cont.tag0.bail=0
cont.tag0.bailcost=0
cont.update
remove
return 1
endif
timer 1
return 1


[EVENTS e_legendjail]
ON=@ClientToolTip
LOCAL.JHOURS=<eval (<i.tag0.jailtime>/3600)>
LOCAL.JMINS=<eval ((<i.tag0.jailtime>/60)-(<LOCAL.JHOURS>*60))>
LOCAL.JSECS=<eval (((<i.tag0.jailtime>-(<LOCAL.JHOURS>*3600))-(<LOCAL.JMINS>*60))>
SRC.ADDCLILOC 1042971,[Jailed <i.tag0.reason>; <eval <LOCAL.JHOURS>>:<eval <LOCAL.JMINS>>:<eval <LOCAL.JSECS>> remaining]




[ITEMDEF i_bail_stone]
ID=i_grave_stone
NAME=bail stone
TYPE=t_normal

ON=@CREATE
COLOR=0455

ON=@DCLICK
IF <SRC.TAG0.BAIL>
SDIALOG d_pay_bail
ENDIF
RETURN 1

[DIALOG d_pay_bail]
0,0
noclose
resizepic 0 0 2620 230 100
dtext 15 5 50 Штраф: <EVAL <SRC.TAG0.BAILCOST>>
dtext 15 25 480 Хотите ли вы платить его?
dtext 140 60 480 Да
dtext 60 60 480 Нет
button 25 60 4005 4006 1 0 0
button 100 60 4005 4006 1 0 1

[DIALOG d_pay_bail BUTTON]
ON=0
RETURN 1

ON=1
if (<SRC.FLAGS> & statf_dead)
return 1
endif
if <SRC.TAG0.BAIL>
IF (<SRC.GOLD> >= <EVAL <SRC.TAG0.BAILCOST>>)
SRC.GOLD -= <EVAL <SRC.TAG0.BAILCOST>>
src.tag0.bail=0
src.tag0.jailtime=1
ELSE
src.sysmessage @025,,1 Вам не хватает золота!
ENDIF
endif

[EOF]

Thank you!


RE: Jailing - pointhz - 08-06-2016 12:00 AM

new.equip <argo.uid>


RE: Jailing - Llirik - 08-06-2016 06:50 AM

Not this ITEM EQUIP on me too! Twice and more... new.cont=<argo.uid> work right but not equipped full Sad

P.S i'm use Sphere 0.56beta!

How equip this item CORRECTLY?!


RE: Jailing - pointhz - 08-07-2016 12:27 AM

Sorry I dont understand what you'r saying xD

You need to add an ID to [ITEMDEF m_jail_clocker],

like

[ITEMDEF m_jail_clocker]
ID=i_memory
NAME=Jail Timer
LAYER = layer_special

ON = @Create
TYPE = t_eq_script


RE: Jailing - Llirik - 08-07-2016 02:01 AM

How EQUIP this item correctly on TARGET player from my function?

new.equip <argo.uid> Don't work! Sad


RE: Jailing - Kanibal - 08-07-2016 08:41 AM

Code:
src.newitem m_jail_clocker
new.equip



RE: Jailing - Llirik - 08-07-2016 08:47 PM

No he EQUIP on me, but not TARGET Sad

I'm be use:
serv.newitem m_jail_clocker
new.cont=<argo.uid>


RE: Jailing - Artyk - 08-10-2016 04:11 AM

From the wiki:
Code:
EQUIP item_uid    Equips an item to the character.

so, supposing that argo is your target, the following should work:
argo.equip <new.uid>


RE: Jailing - Llirik - 08-10-2016 06:51 AM

Thanks! After testing work well!