Jump to content
  • 0

Allowing only 3 same gepard ID in a map


Question

Posted

Hi ! I have a script that disable dual gepard id in a map ... How to make this allow only 3 same gepard ID in map ??? Thanks 

-	script	disable_duals	-1,{
	end;

OnInit:
	// 1= if you have gepard 0=if you do not use gepard
	set .Gepard,1;
	setarray .current_maps$[0] , "pvp_n_1-5",
								 "guild_vs1",
								 "guild_vs2",
								 "guild_vs3",
								 "guild_vs4",
								 "guild_vs5",
								 "pvp_y_1-2",
								 "pvp_y_2-2",
								 "prtg_cas01",
								 "prtg_cas02",
								 "prtg_cas03",
								 "prtg_cas04",
								 "prtg_cas05",
								 "payg_cas01",
								 "payg_cas02",
								 "payg_cas03",
								 "payg_cas04",
								 "payg_cas05",
								 "gefg_cas01",
								 "gefg_cas02",
								 "gefg_cas03",
								 "gefg_cas04",
								 "gefg_cas05",
								 "aldeg_cas01",
								 "aldeg_cas02",
								 "aldeg_cas03",
								 "aldeg_cas04",
								 "aldeg_cas05",
								 "arug_cas01",
								 "arug_cas02",
								 "arug_cas03",
								 "arug_cas04",
								 "arug_cas05",
								 "schg_cas01",
								 "schg_cas02",
								 "schg_cas03",
								 "schg_cas04",
								 "schg_cas05",
								 "ordeal_1-1";
	end;
	
OnPCLoadMapEvent:
	if (.Gepard == 1) {	//GEPARD SHIELD ID CHECKER
		for(set .@i ,0;.@i<getarraysize(.current_maps$);set .@i,.@i+1) {
			if (strcharinfo(3) == .current_maps$[.@i]) {	
				getmapxy(.@map$,.@mapx,.@mapy,BL_PC);
			}
		}	
		query_sql("SELECT last_unique_id FROM `login` WHERE account_id = "+getcharid(3)+"", .@UniqueId$);
		query_sql("SELECT account_id FROM `login` WHERE last_unique_id = '"+.@UniqueId$+"'", .@CuentaId);
		set .@error,getcharid(3,strcharinfo(0));
		
		for(set .@i ,0;.@i<getarraysize(.@CuentaId);set .@i,.@i+1) {
			if(attachrid(.@CuentaId[.@i])) {
				if (.@CuentaId == 2000001) {
					set .@j,0;
				} 
				else {
					getmapxy(.@map2$,.@mapx2,.@mapy2,BL_PC);
					if (.@map2$ == .@map$){
						set .@j,.@j+1;
					}
				}
			}	
		}
		detachrid;
	
		attachrid .@error;
		if(.@j > 1) {
			dispbottom "Sorry, dual login is not allowed on this map.";
			sleep2 500;
			dispbottom "Warping you back to Savepoint now...";
			sleep2 1000;
			warp "SavePoint",0,0;
		}
		end;
	} 
	
	else {
		for(set .@i ,0;.@i<getarraysize(.current_maps$);set .@i,.@i+1) {
			if (strcharinfo(3) == .current_maps$[.@i]) {	
				getmapxy(.@map$,.@mapx,.@mapy,BL_PC);
			}
		}	
		query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", .@UltimaIp$);
		query_sql("SELECT account_id FROM `login` WHERE last_ip = '"+.@UltimaIp$+"'", .@CuentaId);
		set .@error,getcharid(3,strcharinfo(0));
		for(set .@i ,0;.@i<getarraysize(.@CuentaId);set .@i,.@i+1) {
			if(attachrid(.@CuentaId[.@i])) {
		//if .Gepard is 0 add id of accounts to which the system will not affect, brothers, couple, gms, etc ... .@CuentaId == accountId
				if (.@CuentaId == 2000001 || .@cuentaId == 2000156 || .@CuentaId == 2000249 || .@CuentaId == 2000002 || .@CuentaId == 2000031 || .@CuentaId == 2000050 || .@CuentaId == 2000021 || .@CuentaId == 2000073 || .@CuentaId == 2000029) {
					set .@j,0;
				} 
				else {
					getmapxy(.@map2$,.@mapx2,.@mapy2,BL_PC);
					if (.@map2$ == .@map$){
						set .@j,.@j+1;
					}
				}
			}	
		}
		detachrid;
	
		attachrid .@error;
		if(.@j > 1) {
			dispbottom "Sorry, Double Login is not allowed on this map.";
			sleep2 1000;
			dispbottom "Warping you back to Savepoint...";
			sleep2 2000;
			warp "SavePoint",0,0;
		}
		end;
	}
}

 

1 answer to this question

Recommended Posts

  • 0
Posted
		if(.@j > 3) {
			dispbottom "Sorry, only 3 IDs with same Unique ID are allowed on this map.";
			sleep2 500;
			dispbottom "Warping you back to Savepoint now...";
			sleep2 1000;
			warp "SavePoint",0,0;
		}

 

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