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-nmm6 (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-nmm6 (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-nmm6 (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
Jail Stone help
Author Message
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #1
Jail Stone help
So Ive had this script and I remember it working a long time ago, but now when I double click my bail stone my client crashes, really have no clue why its doing this! Any help is appreciated.

Code:
[ITEMDEF i_Bail_stone]

DEFNAME=i_Bail_Stone
name=Bail Stone
ID=i_gravestone_18
TYPE=0
CATEGORY=Jail System
SUBSECTION=Jail Items
DESCRIPTION=Bail Stone

on=@create
color=0054e
attr=010

ON=@dclick
SRC.DIALOG d_bail_stone
RETURN 1


[EVENTS e_jail_timer]

serv.newitem=i_jail_timer
new.p=<src.p>
  new.link=<src.uid>
  src.message @0481 "Your fifteen minutes begins now"
  return 1
ON=@DCLICK
if (<tag0.active>=1)
  if (<link.uid> != <src.uid>)
    src.message "This stone belongs to <link.name>"
    return 1
else
src.forgive
SRC.DIALOG where_to
endif
  endif





[DIALOG d_bail_stone]
100, 100
page 0
resizepic 100 100 2620 400 145
//BUTTONS
button 125 155 2362 2361 1 0 1
button 125 172 2362 2361 1 0 2
button 125 189 2362 2361 1 0 3

TEXT
text 140 110 137 0
text 140 150 268 1
text 140 167 268 2
text 140 184 268 3
text 140 201 268 4




[DIALOG d_bail_stone TEXT]
Choose your payment!
Pay the bail (1000gp)
Serve your sentence (15min)
-1 to all stats

[DIALOG d_bail_stone BUTTON]

ONBUTTON=1

IF <SRC.RESTEST <EVAL <SRC.tag0.BAILCOST>> i_gold>
SRC.CONSUME=<EVAL <SRC.tag0.BAILCOST>> i_gold 1000
SRC.SYSMESSAGE Bail has been payed!
src.forgive
src.go britain
dialogclose d_bail_stone BUTTON
RETURN 1
ELSE
SRC.SYSMESSAGE You do not have enough gold in your pack
SRC.BANKSELF
dialogclose d_bail_stone BUTTON
RETURN 1
ENDIF


ONBUTTON=2
src.jailstone
dialogclose d_bail_stone BUTTON

ONBUTTON=3
src.str -= 1
src.dex -= 1
src.int -= 1
dialogclose d_bail_stone BUTTON
SRC.DIALOG where_to

[DIALOG where_to]
100, 100
page 0
resizepic 100 100 2620 400 165

//BUTTONS
button 125 155 2362 2361 1 0 1 //Britain
button 125 172 2362 2361 1 0 2 //Sherwood
button 125 189 2362 2361 1 0 3 //Trinsic
button 125 206 2362 2361 1 0 4 //Vesper
button 125 223 2362 2361 1 0 5 //Yew

//Text
text 150 110 137 0
text 150 150 168 1
text 150 168 268 2
text 150 185 268 3
text 150 203 268 4
text 150 220 268 5

[DIALOG where_to TEXT]
please choose your destination
Britain
Sherwood
Trinsic
Vesper
Yew

[DIALOG where_to BUTTON]

ONBUTTON=1
src.forgive
SRC.GO 1495,1630,10
SOUND 00Ff
Return 0

ONBUTTON=2
src.forgive
SRC.GO 1825,846,-1
SOUND 00Ff
Return 0

ONBUTTON=3
src.forgive
SRC.GO 1846,2780,0
SOUND 00Ff

ONBUTTON=4
src.forgive
SRC.GO 2871,703,0
SOUND 00Ff

ONBUTTON=5
src.forgive  
SRC.GO 550,1004,0
SOUND 00Ff

[DIALOG d_bail_stone]
100, 100
page 0
resizepic 100 100 2620 400 145
//BUTTONS
button 125 155 2362 2361 1 0 1
button 125 172 2362 2361 1 0 2
button 125 189 2362 2361 1 0 3

TEXT
text 140 110 137 0
text 140 150 268 1
text 140 167 268 2
text 140 184 268 3
text 140 201 268 4


[FUNCTION consumebank]
act=
act.layer=layer_pack
act.type=t_container
act.equip

src.consume

act.layer=layer_bankbox
act.type=t_eq_bank_box
act.equip

[PLEVEL 1]
jailstone

[FUNCTION jailstone]

serv.newitem=i_jail_timer
  new.p=<src.p>
  new.link=<src.uid>
  src.message @0481 "Your sentence begins now"
  return 1

[ITEMDEF i_jail_timer]

NAME=Jail Timer
ID=i_crystal_red
TYPE=t_normal

ON=@CREATE
attr=attr_move_never
color=69
more1=900
timer=1

On=@DClick
if (<tag0.active>=1)
  if (<link.uid> != <src.uid>)
    src.message "This stone belongs to <link.name>"
    return 1
  else
    src.DIALOG where_to
    remove
    return 1
  endif
else
  src.message "Be quiet prisoner!"
  return 1
endif

On=@Timer
if (<more1> > 0)
  say <eval <more1>>
  more1 -= 1
  timer=1
  return 1
else
  sfx 489
  tag.active=1
  timerf 30,remove
  return 1
endif

[eof]
01-15-2014 07:49 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Jail Stone help
There are two [dialog d_bail_stone] defined, and the last one looks wrong.

Also this part of code is not covered by any triggers inside the event
PHP Code:
[EVENTS e_jail_timer]

serv.newitem=i_jail_timer
new.p=<src.p>
  new.
link=<src.uid>
  
src.message @0481 "Your fifteen minutes begins now"
  
return 
01-15-2014 07:59 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Jail Stone help
Code:
[DIALOG d_bail_stone]
100, 100
page 0
resizepic 100 100 2620 400 145
//BUTTONS
button 125 155 2362 2361 1 0 1
button 125 172 2362 2361 1 0 2
button 125 189 2362 2361 1 0 3

TEXT
text 140 110 137 0
text 140 150 268 1
text 140 167 268 2
text 140 184 268 3
text 140 201 268 4

Old... outdated scripting method using text instead of dtext and having no text block will crash your client because the dialog renders badly.

[Image: 2nis46r.jpg]
01-15-2014 09:08 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #4
RE: Jail Stone help
Guess I could have tried a little harder at looking at it than asking Tongue Thank you guys
01-15-2014 11:25 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)