Jump to content
  • 0
lirycjames

Request for @recallmap

Question

8 answers to this question

Recommended Posts

  • 1

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
Link to comment
Share on other sites

or try

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

 
-    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
Link to comment
Share on other sites

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 :)

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.