• 0
Sign in to follow this  
Followers 0
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 [email protected]$[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 [email protected]$[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 ( [email protected] = 0; [email protected] < getarraysize( [email protected]$ ); [email protected]++ ) {
		if ( !getmapflag( [email protected]$[[email protected]], mf_loadevent ) ) {
			setmapflag [email protected]$[[email protected]], mf_loadevent;
		}
	}

	.map_list$ = implode( [email protected]$, "|" );

	[email protected] = 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", [email protected]_uid$, [email protected]$, [email protected]_id );
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		getmapxy [email protected]$, [email protected], [email protected], 0, [email protected]$[[email protected]];
		if ( !compare( .map_list$, [email protected]$ ) ) continue;
		[email protected] = 0;
		[email protected]$ = ".uid_"+ [email protected]_uid$[[email protected]] +"$";
		if ( getd( [email protected]$ ) != "" ) {
			[email protected] = getarraysize( getd( [email protected]$ ) );
			for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
				getmapxy [email protected]$, [email protected], [email protected], 0, getd( [email protected]$ +"["+ [email protected] +"]" );
				if ( [email protected]$ == [email protected]$ ) {
					warpchar "SavePoint",0,0, [email protected]_id[[email protected]];
					message [email protected]$[[email protected]], "No dual account on this map.";
					break;
				}
			}
		}
		if ( [email protected] == [email protected] ) {
			setd [email protected]$ +"["+ [email protected] +"]", [email protected]$[[email protected]];
		}
	}
	end;

	OnPCLoadMapEvent:
	if ( !compare( .map_list$, strcharinfo(3) ) ) end;
	[email protected]$ = strcharinfo(3);
	[email protected]$ = strcharinfo(0);
	[email protected]$ = ".uid_"+ get_unique_id() +"$";
	[email protected] = getarraysize( getd( [email protected]$ ) );
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if ( [email protected]$ == getd( [email protected]$ +"["+ [email protected] +"]" ) ) {
			[email protected]_in = 1;
			continue;
		}
		getmapxy [email protected]$, [email protected], [email protected], 0, getd( [email protected]$ +"["+ [email protected] +"]" );
		[email protected] = compare( .map_list$, [email protected]$ );
		if ( [email protected]  ) {
			[email protected]$ = [email protected]$ +"["+ [email protected] +"]";
			deletearray getd( [email protected]$ ), 1;
			[email protected];
		}
		else if ( [email protected]$ == [email protected]$ ) {
			warpchar "SavePoint",0,0, getcharid(0);
			message [email protected]$, "No dual account on this map.";
			end;
		}
	}
	if ( [email protected]_in ) {
		setd [email protected]$ +"["+ [email protected] +"]", [email protected]$;
	}
	end;
}

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0