return value from

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.

Moderator: POL Developer

Post Reply
User avatar
hunt3r
New User
Posts: 11
Joined: Tue Mar 25, 2008 11:17 am

return value from

Post by hunt3r »

I wanna show a message when a MoveCharacterToLocation fails...

Code: Select all

    var final:=MoveCharacterToLocation( who, jump_x, jump_y, jump_z );
    if( CInt(final) != 1 )
      ...
   endif
I've also tried with

Code: Select all

if (final != 1 )
if(!final)
if(final==error)
none of this methods works...

I "printed" the final var and this was what it shows
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
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Post by *Edwards »

Code: Select all

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
User avatar
hunt3r
New User
Posts: 11
Joined: Tue Mar 25, 2008 11:17 am

Post by hunt3r »

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!
User avatar
*Edwards
Forum Regular
Posts: 303
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Post by *Edwards »

http://docs.polserver.com/pol097/escrip ... tml#chap1a

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