Jump to content
  • 0

Warp Scroll


Question

Posted (edited)

So, could someone help me with a scroll that when be used appear a

bar and you can write one map coordinates and you will be teleported to this place, like @warp but as an item ?

Edited by nunesb

7 answers to this question

Recommended Posts

Posted

    message strcharinfo(0),"Teleport to...";
   dispbottom "map,x,y";
   input .@i$;
   explode(.@j$,.@i$,",");
   if (getmapusers(.@j$[0]) >= 0) {
       delitem your_item,1; // Type item ID here
       warp .@j$[0], atoi(.@j$[1]), atoi(.@j$[2]);
   } else
       message strcharinfo(0),"Invalid map.";
   end;

Item type 11.

  • Upvote 1
Posted (edited)

I did it

function	script	scrollwarpzz	{
message strcharinfo(0),"Teleport to...";
dispbottom "map,x,y";
input .@i$;
explode(.@j$,.@i$,",");
if (getmapusers(.@j$[0]) >= 0) {
	delitem your_item,12219;
	warp .@j$[0], atoi(.@j$[1]), atoi(.@j$[2]);
} else
	message strcharinfo(0),"Invalid map.";
end;
}

and in the script item:

{ callfunc "scrollwarpzz"; }

item type 11,

why do not works ?

Edited by nunesb
Posted (edited)

http://www.eathena.ws/board/index.php?s=&showtopic=238404&view=findpost&p=1500001

updating this script

function    script    tele_device    {
if ( getmapflag( strcharinfo(3), mf_nowarp ) ) {
	dispbottom "Teleport Device : you can't use this device on this map";
	end;
}
if ( input( .@input$, 4, 21 ) ) {
	dispbottom "Teleport Device : invalid string length";
	end;
}
if ( sscanf( .@input$, "%15s %d %d", .@map$, .@x, .@y ) < 3 ) {
	if ( sscanf( .@input$, "%15[^,],%d,%d", .@map$, .@x, .@y ) < 1 ) {
		dispbottom "Teleport Device : invalid format. Usage: <mapname> <x> <y>";
		end;
	}
}
if ( getmapusers( .@map$ ) == -1 ) {
	dispbottom "Teleport Device : no such map";
	end;
}
if ( getmapflag( .@map$, mf_nowarpto ) ) {
	dispbottom "Teleport Device : you can't warp to this map";
	end;
}
if ( ( .@x || .@y ) && checkcell( .@map$, .@x, .@y, cell_chknopass ) ) {
	dispbottom "Teleport Device : invalid coordinate";
	end;
}
//	delitem 10000,1; // uncomment this for limited use
warp .@map$, .@x, .@y;
end;
}

but this sscanf post out some !@# error when user input invalid format <.<

dunno but somehow I want to file a report for it

http://rathena.org/board/tracker/issue-7059-sscanf-script-command-display-error-in-map-server/

EDIT: and I want to edit this script somemore =/

done ...

EDITED again <.< this time follows the atcommand.c

Edited by AnnieRuru

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...