Jump to content
  • 0
Eross

Allowing only 3 same gepard ID in a map

Question

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 [email protected] ,0;[email protected]<getarraysize(.current_maps$);set [email protected],[email protected]+1) {
			if (strcharinfo(3) == .current_maps$[[email protected]]) {	
				getmapxy([email protected]$,[email protected],[email protected],BL_PC);
			}
		}	
		query_sql("SELECT last_unique_id FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$);
		query_sql("SELECT account_id FROM `login` WHERE last_unique_id = '"[email protected]$+"'", [email protected]);
		set [email protected],getcharid(3,strcharinfo(0));
		
		for(set [email protected] ,0;[email protected]<getarraysize([email protected]CuentaId);set [email protected]i,[email protected]i+1) {
			if(attachrid([email protected]CuentaId[[email protected]i])) {
				if ([email protected]CuentaId == 2000001) {
					set [email protected]j,0;
				} 
				else {
					getmapxy([email protected]map2$,[email protected]mapx2,[email protected]mapy2,BL_PC);
					if ([email protected]map2$ == [email protected]map$){
						set [email protected]j,[email protected]j+1;
					}
				}
			}	
		}
		detachrid;
	
		attachrid [email protected]error;
		if([email protected]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 [email protected] ,0;[email protected]<getarraysize(.current_maps$);set [email protected],[email protected]+1) {
			if (strcharinfo(3) == .current_maps$[[email protected]]) {	
				getmapxy([email protected]$,[email protected],[email protected],BL_PC);
			}
		}	
		query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", [email protected]$);
		query_sql("SELECT account_id FROM `login` WHERE last_ip = '"[email protected]$+"'", [email protected]);
		set [email protected],getcharid(3,strcharinfo(0));
		for(set [email protected] ,0;[email protected]<getarraysize([email protected]CuentaId);set [email protected]i,[email protected]i+1) {
			if(attachrid([email protected]CuentaId[[email protected]i])) {
		//if .Gepard is 0 add id of accounts to which the system will not affect, brothers, couple, gms, etc ... [email protected]CuentaId == accountId
				if ([email protected]CuentaId == 2000001 || [email protected]cuentaId == 2000156 || [email protected]CuentaId == 2000249 || [email protected]CuentaId == 2000002 || [email protected]CuentaId == 2000031 || [email protected]CuentaId == 2000050 || [email protected]CuentaId == 2000021 || [email protected]CuentaId == 2000073 || [email protected]CuentaId == 2000029) {
					set [email protected]j,0;
				} 
				else {
					getmapxy([email protected]map2$,[email protected]mapx2,[email protected]mapy2,BL_PC);
					if ([email protected]map2$ == [email protected]map$){
						set [email protected]j,[email protected]j+1;
					}
				}
			}	
		}
		detachrid;
	
		attachrid [email protected]error;
		if([email protected]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;
	}
}

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
		if([email protected] > 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;
		}

 

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.