Creating MDestroy Script
Posted: Mon May 05, 2014 3:02 pm
Trying to create a script similar to mtele but it deletes things instead of teleporting you.
I have this so far, but it tells me that "var location has not been declared".
I have this so far, but it tells me that "var location has not been declared".
Code: Select all
use uo;
include "include/security";
program textcmd_MDestroy( mobile )
if( !AuthorizationCode( mobile ))
SendSysMessage( mobile, "Cancelled." );use uo;
include "include/security";
program textcmd_Destroy( mobile )
if( !AuthorizationCode( mobile ))
SendSysMessage( mobile, "Cancelled." );
return 0;
endif
SendSysMessage( mobile, "What do you want to destroy?" );
var targ := TargetCoordinates( mobile ).item;
if( !targ )
SendSysMessage( mobile, "Cancelled." );
return 0;
endif
var result := DestroyItem( targ );
if( result.errortext )
SendSysMessage( mobile, "DestroyItem() Error - "+result.errortext );
return 0;
endif
return 1;
endprogram
return 0;
endif
SendSysMessage( mobile, "What do you want to destroy?" );
var targ := TargetCoordinates( mobile ).item;
if( !targ )
SendSysMessage( mobile, "Cancelled." );
return 0;
endif
var result := DestroyItem( targ );
if( result.errortext )
SendSysMessage( mobile, "DestroyItem() Error - "+result.errortext );
return 0;
endif
return 1;
endprogram