PenUltima Online

It is currently Wed Aug 20, 2008 2:37 pm

All times are UTC - 4 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: return value from
PostPosted: Wed Apr 02, 2008 12:00 am 
Offline
User avatar

Joined: Tue Mar 25, 2008 3:17 pm
Posts: 11
I wanna show a message when a MoveCharacterToLocation fails...

Code:
    var final:=MoveCharacterToLocation( who, jump_x, jump_y, jump_z );
    if( CInt(final) != 1 )
      ...
   endif


I've also tried with
Code:
if (final != 1 )
if(!final)
if(final==error)


none of this methods works...

I "printed" the final var and this was what it shows
Quote:
error{ errorText = "Can't go there" }


the point is... that var (final) returns 1 when success, and a error array when fails...
but I can't get the fail status on an if statement.

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 12:45 am 
Offline
User avatar

Joined: Sat Dec 29, 2007 3:19 am
Posts: 91
Location: Montreal, Canada
Code:
var final := MoveCharacterToLocation( who, jump_x, jump_y, jump_z );
if( final.errortext )
SendSysMessage( who, "The error is: "+final.errortext );
endif


If you would get the statut you can always use:

If( !final ) // means that final has failed.
If( final ) // if success, do something...

http://docs.polserver.com/pol095/objref.php

_________________
Image
FantasiaShard.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 4:49 pm 
Offline
User avatar

Joined: Tue Mar 25, 2008 3:17 pm
Posts: 11
Thanks bud!
I`ll try that...

both
if(!final) and if(final) I`ve already tested and didn`t worked at all..

I`ll try final.errortext and see what happens :D

Thank once more!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 5:52 pm 
Offline
User avatar

Joined: Sat Dec 29, 2007 3:19 am
Posts: 91
Location: Montreal, Canada
http://docs.polserver.com/pol097/escrip ... tml#chap1a

It's great tool for getting started. It's mostly the basic language theory.

_________________
Image
FantasiaShard.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 4 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl