Jump to content
  • 0
Sign in to follow this  
Virtue

Need help with Dual Client Kicker

Question

Hello All,

This script doesn't seem to do the trick. Nothing happens & it doesn't kick dual clients on the maps not listed on this array

setarray .@map$[0], "prontera","morocc","geffen","payon","alberta","izlude","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","jawaii","ayothaya","einbroch","lighthalzen","einbech","hugel","rachel","veins","moscovia";

Anyway, I want to allow dual clients only on the towns/maps listed on the array. full script below

-	script	dual_client	FAKE_NPC,{

	OnInit:
	setarray .@map$[0], "prontera","morocc","geffen","payon","alberta","izlude","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","jawaii","ayothaya","einbroch","lighthalzen","einbech","hugel","rachel","veins","moscovia";	// yours maps no dual

	for ( .@i = 0; .@i < getarraysize( .@map$ ); .@i++ ) {
		if ( !getmapflag( .@map$[.@i], mf_loadevent ) ) {
			setmapflag .@map$[.@i], mf_loadevent;
		}
	}

	.map_list$ = implode( .@map$, "|" );

	.@count = query_sql( "select `login`.`last_unique_id`, `char`.`name`, `char`.`char_id` from `login` left join `char` on `char`.`account_id`=`login`.`account_id` where `char`.`online`=1", .@last_uid$, .@name$, .@char_id );
	for ( .@i = 0; .@i < .@count; .@i++ ) {
		getmapxy .@map$, .@x, .@y, 0, .@name$[.@i];
		if ( !compare( .map_list$, .@map$ ) ) continue;
		.@size = 0;
		.@variable$ = ".uid_"+ .@last_uid$[.@i] +"$";
		if ( getd( .@variable$ ) != "" ) {
			.@size = getarraysize( getd( .@variable$ ) );
			for ( .@j = 0; .@j < .@size; .@j++ ) {
				getmapxy .@map2$, .@x, .@y, 0, getd( .@variable$ +"["+ .@j +"]" );
				if ( .@map$ == .@map2$ ) {
					warpchar "SavePoint",0,0, .@char_id[.@i];
					message .@name$[.@i], "No dual account on this map.";
					break;
				}
			}
		}
		if ( .@j == .@size ) {
			setd .@variable$ +"["+ .@size +"]", .@name$[.@i];
		}
	}
	end;

	OnPCLoadMapEvent:
	if ( !compare( .map_list$, strcharinfo(3) ) ) end;
	.@map$ = strcharinfo(3);
	.@myname$ = strcharinfo(0);
	.@variable$ = ".uid_"+ get_unique_id() +"$";
	.@size = getarraysize( getd( .@variable$ ) );
	for ( .@j = 0; .@j < .@size; .@j++ ) {
		if ( .@myname$ == getd( .@variable$ +"["+ .@j +"]" ) ) {
			.@is_in = 1;
			continue;
		}
		getmapxy .@map2$, .@x, .@y, 0, getd( .@variable$ +"["+ .@j +"]" );
		.@compare = compare( .map_list$, .@map2$ );
		if ( !.@compare  ) {
			.@tmp$ = .@variable$ +"["+ .@j +"]";
			deletearray getd( .@tmp$ ), 1;
			.@size--;
		}
		else if ( .@map$ == .@map2$ ) {
			warpchar "SavePoint",0,0, getcharid(0);
			message .@myname$, "No dual account on this map.";
			end;
		}
	}
	if ( !.@is_in ) {
		setd .@variable$ +"["+ .@size +"]", .@myname$;
	}
	end;
}

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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