PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
return value from

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
hunt3r



Joined: 25 Mar 2008
Posts: 11

PostPosted: Wed Apr 02, 2008 12:00 am    Post subject: return value from Reply with quote

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

Author Message
*Edwards



Joined: 29 Dec 2007
Posts: 61
Location: Montreal, Canada

PostPosted: Wed Apr 02, 2008 12:45 am    Post subject: Reply with quote

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

Author Message
hunt3r



Joined: 25 Mar 2008
Posts: 11

PostPosted: Wed Apr 02, 2008 4:49 pm    Post subject: Reply with quote

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 Very Happy

Thank once more!

Author Message
*Edwards



Joined: 29 Dec 2007
Posts: 61
Location: Montreal, Canada

PostPosted: Wed Apr 02, 2008 5:52 pm    Post subject: Reply with quote

http://docs.polserver.com/pol097/escriptguide.html#chap1a

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

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty