Jump to content
  • 0

Request for @recallmap


Question

8 answers to this question

Recommended Posts

Posted

or try

-	script	atcmd_examplere	-1,{
OnInit:
	bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60;
	end;
OnAtcommand:
	.@count = query_sql( "select `char_id`, name from `char` where `last_map` = '"+ strcharinfo(3) +"' and `char_id` != "+ getcharid(0) +" and online = 1 limit 128", .@char_id, .@name$ );
	if ( .@count == 0 )
		message strcharinfo(0), "There is none player on this map except you.";
	else {
		getmapxy .@map$, .@x, .@y, 0;
		.@myname$ = strcharinfo(0);
		while( .@i < .@count ) {
			warpchar .@map$, .@x, .@y, .@char_id[.@i];
			message .@name$[.@i], "You have been recalled by "+ .@myname$ +".";
			.@i++;
		}
		message strcharinfo(0), .@count +" player(s) recalled.";
	}
	end;
}
  • Upvote 1
Posted (edited)
 
-    script    atcmd_examplere    -1,{

OnInit:

    bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60;

    end;

OnAtcommand:

    .@count = query_sql( "select `char_id`, name from `char` where `last_map` = '"+ strcharinfo(3) +"' and `char_id` != "+ getcharid(0) +" and online = 1 limit 128", .@char_id, .@name$ );

    if ( .@count == 0 )

        message strcharinfo(0), "There is none player on this map except you.";

    else {

        getmapxy .@map$, .@x, .@y, 0;

        .@myname$ = strcharinfo(0);

        while( .@i < .@count ) {

            warpchar .@map$, .@x, .@y, .@char_id[.@i];

            message .@name$[.@i], "You have been recalled by "+ .@myname$ +".";

            .@i++;

        }

        message strcharinfo(0), .@count +" player(s) recalled.";

    }

    end;

}

 

this one is working.. but.. I think theres a 2-3 minutes delay when using @recallmap when I jump in different maps.. 
Edited by lirycjames
  • 1
Posted

The delay is because of the update delay of char.last_map

try

-	script	atcmd_examplere	-1,{
OnInit:
	bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60;
	end;
OnAtcommand:
	getmapxy .map_self$, .x_self, .y_self, 0;
	.myname$ = strcharinfo(0);
	.count = 0;
	addrid 0;
	if ( strcharinfo(3) == .map_self$ && strcharinfo(0) != .myname$ ) {
		message strcharinfo(0), "You have been recalled by "+ .myname$ +".";
		warp .map_self$, .x_self, .y_self;
		.count++;
	}
	if ( strcharinfo(0) != .myname$ ) end;
	sleep2 10;
	if ( .count == 0 )
		message strcharinfo(0), "There is none player on this map except you.";
	else
		message strcharinfo(0), .count +" player(s) recalled.";
	end;
}

 


 

  • Upvote 1
Posted

The delay is because of the update delay of char.last_map

try

-	script	atcmd_examplere	-1,{
OnInit:
	bindatcmd "recallmap",strnpcinfo(3)+"::OnAtcommand",60,60;
	end;
OnAtcommand:
	getmapxy .map_self$, .x_self, .y_self, 0;
	.myname$ = strcharinfo(0);
	.count = 0;
	addrid 0;
	if ( strcharinfo(3) == .map_self$ && strcharinfo(0) != .myname$ ) {
		message strcharinfo(0), "You have been recalled by "+ .myname$ +".";
		warp .map_self$, .x_self, .y_self;
		.count++;
	}
	if ( strcharinfo(0) != .myname$ ) end;
	sleep2 10;
	if ( .count == 0 )
		message strcharinfo(0), "There is none player on this map except you.";
	else
		message strcharinfo(0), .count +" player(s) recalled.";
	end;
}

 

 

error on " line 9 " after i reload the script .. and it can't recall players on map, it always say "There is none player on this map except you." .. thank you for the reply :)

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