[PLEVEL 4]
PUNISH

[FUNCTION PUNISH]
IF (<ISEMPTY <ARGS>>)
SYSMESSAGE @33 Usage:
SYSMESSAGE @33 .j jail time minutes/hours/days
ELIF !(STRMATCH(*delete*,<ARGS>)) && !(STRMATCH(*BLOCK*,<ARGS>)) && !(STRMATCH(*JAIL*,<ARGS>)) && !(STRMATCH(*BAN*,<ARGS>))
SYSMESSAGE @33 Usage:
SYSMESSAGE @33 .j jail time minutes/hours/days
ELIF !(STRMATCH(*minutes*,<ARGS>)) && !(STRMATCH(*hours*,<ARGS>)) && !(STRMATCH(*days*,<ARGS>)) && !(STRMATCH(*delete*,<ARGS>)) && !(STRMATCH(*BLOCK*,<STRARG <ARGS>>))
SYSMESSAGE @33 Usage:
SYSMESSAGE @33 .j jail time minutes/hours/days
ELIF !(STRMATCH(*[0-9]*,<ARGS>)) && !(STRMATCH(*delete*,<ARGS>)) && !(STRMATCH(*BLOCK*,<STRARG <ARGS>>))
SYSMESSAGE @33 Usage:
SYSMESSAGE @33 .j jail time minutes/hours/days
ELSE
TARGETF TARGET_PUNISH <ARGS>
SYSMESSAGE @33 Who to punish?
ENDIF

[FUNCTION TARGET_PUNISH]
IF (<ARGO.ISITEM>) || !(<ARGO.ISPLAYER>)
SYSMESSAGE @33 You can't punish that.
return 1
ENDIF

IF (<ARGO.ACCOUNT.PLEVEL> > 3)
SYSMESSAGE @33 You can't punish a staff member.
RETURN 1
ENDIF

LOCAL.TMP=<OBJ>
OBJ=<ARGO.UID>

IF (STRMATCH(*delete*,<ARGS>))
FOR 10 1
IF (<LOCAL._FOR>!=1)
TRY VAR.PENA<EVAL <LOCAL._FOR>>=<VAR.PENA<EVAL <LOCAL._FOR>-1>>
ELSE
VAR.PENA1=<NAME> deleted the acc of <obj.name>. Date: <rtime.day>/<rtime.month>/<rtime.year>
ENDIF
ENDFOR
OBJ.ACCOUNT.DELETE
OBJ=<LOCAL.TMP>
RETURN 1
ENDIF

IF (STRMATCH(*BLOCK*,<STRARG <ARGS>>))
OBJ.JAIL
OBJ.ACCOUNT.BLOCK 1
FOR 10 1
IF (<LOCAL._FOR>!=1)
TRY VAR.PENA<EVAL <LOCAL._FOR>>=<VAR.PENA<EVAL <LOCAL._FOR>-1>>
ELSE
VAR.PENA1=<NAME> blocked the acc of <obj.name>. Date: <rtime.day>/<rtime.month>/<rtime.year>
ENDIF
ENDFOR
OBJ=<LOCAL.TMP>
RETURN 1
ENDIF

LOCAL.TIME=<strarg <streat <args>>>
LOCAL.PERIOD=<streat <streat <args>>>

IF !(strcmpi(secs,<LOCAL.PERIOD>))
LOCAL.MULT=1
ELIF !(strcmpi(minutes,<LOCAL.PERIOD>))
LOCAL.MULT=60
ELIF !(strcmpi(hours,<LOCAL.PERIOD>))
LOCAL.MULT=<EVAL 60*60>
ELIF !(strcmpi(days,<LOCAL.PERIOD>))
LOCAL.MULT=<EVAL 60*60*24>
ENDIF

IF !(strcmpi(JAIL,<STRARG <ARGS>>))
OBJ.JAIL
SERV.NEWITEM i_jail_forgive
NEW.CONT=<OBJ>
NEW.ATTR=attr_invis|attr_decay
NEW.TIMER=<EVAL <LOCAL.TIME>*<LOCAL.MULT>>
FOR 10 1
IF (<LOCAL._FOR>!=1)
TRY VAR.PENA<EVAL <LOCAL._FOR>>=<VAR.PENA<EVAL <LOCAL._FOR>-1>>
ELSE
VAR.PENA1=<NAME> has given <STRARG <ARGS>> for <dLOCAL.TIME> <LOCAL.PERIOD> on <obj.name>. Date: <rtime.day>/<rtime.month>/<rtime.year>
ENDIF
ENDFOR
OBJ=<LOCAL.TMP>
RETURN 1
ENDIF

IF !(strcmpi(BAN,<STRARG <ARGS>>))
OBJ.GO Mercado
SERV.NEWITEM i_unblock_timer
NEW.P=<OBJ.P>
NEW.ATTR=attr_invis|attr_decay|attr_move_never
NEW.TIMER=<EVAL <LOCAL.TIME>*<LOCAL.MULT>>
NEW.MORE1=<OBJ.ACCOUNT.PRIV>
NEW.LINK=<OBJ>
NEW.NAME=Unblock timer de <obj.name> (<obj.account>,<obj.uid>)
FOR 10 1
IF (<LOCAL._FOR>!=1)
TRY VAR.PENA<EVAL <LOCAL._FOR>>=<VAR.PENA<EVAL <LOCAL._FOR>-1>>
ELSE
VAR.PENA1=<NAME> has given <STRARG <ARGS>> for <dLOCAL.TIME> <LOCAL.PERIOD> on <obj.name>. Date: <rtime.day>/<rtime.month>/<rtime.year>
ENDIF
ENDFOR
OBJ.ACCOUNT.BLOCK 1
OBJ=<LOCAL.TMP>
RETURN 1
ENDIF
OBJ.ACCOUNT.BLOCK 1
OBJ=<LOCAL.TMP>
SYSMESSAGE @033 Usage:
SYSMESSAGE @033 .j jail time is_the_time_in_minutes/hours/days
RETURN 1

//////////////////////////

[ITEMDEF i_jail_forgive]
NAME=Jail Forgive Timer
ID=i_memory
TYPE=t_eq_script
LAYER=layer_special

ON=@Create
attr=attr_invis|attr_decay

ON=@Timer
CONT.FORGIVE
CONT.GO Help Room
REMOVE
RETURN 1

//////////////////////////

[ITEMDEF I_UNBLOCK_TIMER]
NAME=Unblock Timer
ID=049b
TYPE=t_normal

ON=@Create
color=07ad
attr=attr_invis|attr_decay|attr_move_never

ON=@Timer
LINK.ACCOUNT.BLOCK 0
LINK.ACCOUNT.PRIVS=<MORE1>
SERV.SAVE 1
REMOVE
RETURN 1

[EOF]