Jump to content
  • 0

H> Fixing this warping function


utofaery

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  

I need help fixing this part of the script



function	script	F_MvpArenaWarp	{
	.@warpName$ = getmapinfo( strnpcinfo(3);   // //pvp_n_3-4
	.@nextwarp1$ = substr( .@warpName$ , 0, 5 ); //pvp_n_
	.@nextwarp2$ = substr( .@warpName$ , 6, 6 ); //3
	.@nextwarp3$ = substr( .@warpName$ , 7, 8 ); //-4

	.@i = .@nextwarp2$;
	.@i = .@i + 1;
	.@nextwarp2$ = .@i;
	.@warpMap$ = .@nextwarp1$ + .@nextwarp2$ + .@nextwarp3$ ;

	dispbottom ( "Warped to :: " + .@warpName$ );
	sleep (500); 
	warp .@warpMap$,102,102;
	end;

}

 

    .@warpName$ = getmapinfo( strnpcinfo(3);   // //pvp_n_3-4 

this is the line not working.  always returning 0 in game.

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  477
  • Reputation:   269
  • Joined:  06/13/17
  • Last Seen:  

 .@warpName$ = getmapinfo( strnpcinfo(3) );  <--- missing 1 brace

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  228
  • Reputation:   19
  • Joined:  10/27/12
  • Last Seen:  


    .@warpName$ = getmapinfo( strnpcinfo(3) );   // //pvp_n_3-4

For you suggestion map server spit out the error on this

Spoiler

    parse_line: expected ';'
     3 : {
*    4 :        .@warpName$ = getmapinfo( strnpcinfo(3) ')';   // //pvp_n_3-4

Or is there any other command I can resort to get what map name player or the interacting NPC map name with?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,155,185,5	script	kjsdhfkh	1_F_MARIA,{
	mes "warp to MVP arena";
	next;
	for ( .@i = 1; .@i <= 8; ++.@i ) {
		if ( !getmapusers( "pvp_n_"+ .@i +"-4" ) ) {
			warp "pvp_n_"+ .@i +"-4", 100, 100;
			end;
		}
	}
	mes "All 8 rooms are occupied";
	close;
}

hmm ... I remember using getmapusers are not realiable... because the getmapusers check only when the player finished loading in the map
so if having 2 or more players register at the same time, they might see each other
that's why my private mvp room script use a variable instead of using getmapusers script command to check available map

seriously though, this script can be done using instance ... then they never see each other

Link to comment
Share on other sites

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.

×
×
  • Create New...