Jump to content
  • 0

Show player map on npc


kronobr

Question


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.02
  • Content Count:  71
  • Reputation:   0
  • Joined:  06/24/19
  • Last Seen:  

prontera,157,178,5    script    dedoduro    757,{
   if ( getgmlevel() < 80 ) end;
   mes "Input Player Name";
   if ( input( .@input$, 4, 23 ) ) {
       mes "invalid name length";
       close;
   }
   if ( set( .@nb, query_sql( "select name, online from `char` where account_id = ( select account_id from `char` where name = '"+ escape_sql(.@input$) +"' ) order by char_num", .@name$, .@online ) ) )
       for ( set .@i, 0; .@i < .@nb; set .@i, .@i +1 )
           mes " > "+ .@name$[.@i] +" "+( ( .@online[.@i] )? "^00FF00[Online]" : "^FF0000[Offline]" )+"^000000";
           //here// mes .@name$ + !getmapxy( .@map$, .@x, .@y, 0, .name$[.@s] ) && .@map$ != strcharinfo(3);
   else
       mes "No character found";
   close;
}

HELLO EVERYONE, I need help with this npc. I need this npc to show the map the player is on. I tried to do it but it's not working . Thanks   
 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2361
  • Joined:  10/28/11
  • Last Seen:  

prontera,157,178,5    script    dedoduro    757,{
	if ( getgmlevel() < 80 ) end;
	mes "Input Player Name";
	if ( input( .@input$, 4, 23 ) ) {
		mes "invalid name length";
		close;
	}
	.@size = query_sql("SELECT `name`, `online` FROM `char` WHERE `name` LIKE '%"+ escape_sql(.@input$) +"%' ) ORDER BY `online`", .@name$, .@online);
	if (.@size) {
		for (.@i = 0; .@i < .@size; .@i++) {
			mes .@name$[.@i]+" ("+(.@online[.@i] ? "^00FF00[Online]":"^FF0000[Offline]")+"^000000)";
			if (.@online[.@i]) {
				if (!getmapxy(.@map$, .@x, .@y, BL_PC, .@name$[.@i]))
					mes "coordinate: ("+.@map$+", "+.@x+", "+.@y+")";
			}
		}
	}
	else {
		mes "player '"+.@input$+"' not found.";
	}
	close;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  931
  • Reputation:   173
  • Joined:  04/05/13
  • Last Seen:  

If you don't mind, you can use

atcommand "@whereis " + .@input$";

 

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...