Jump to content
  • 0
Sign in to follow this  
Hadeszeus

About 1 Per Mac IP except vending or @AT

Question

I have a problem with this script I found here source


I want to disable DUAL login using last_mac but I need to exclude the check on players in vending and @at mode.

How can I modify this script?

 

-	script	Only1perMAC	-1,{OnPCLoginEvent:	if (getgmlevel() >= 99) end;	set .@name$, strcharinfo(0);	if (query_sql("SELECT `char`.`name` FROM `char` LEFT JOIN login ON `char`.account_id=login.account_id WHERE login.last_mac=(SELECT last_mac FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1 AND `char`.char_id!="+getcharid(0), .@name$) >= 1) {		for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {			if (checkvending(.@name$[.@i]) != 2)				set .@samemac, .@samemac +1;		}		if (.@samemac >= 1) {			announce "Sorry, only 1 account per computer can be logged in at a time.", bc_self;			sleep 1000;			atcommand "@kick " + .@name$;		}	}	end;}

 

Thank you!
 

Share this post


Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

hi i know its off- topic but can i ask even if he/she is not in @at/vendor still last_mac will be checked. and if 2 same mac is login, you will be @jail [hours/days]

Share this post


Link to post
Share on other sites
  • 0

Here's my own version, using temporary global vars for to allow for other uses of these MAC addresses (assuming you know what to do with them).

 

-	script	dual_check	-1,{	/*-----------------------------------------------------	Determine MAC address [Harmony]	-----------------------------------------------------*/	function getmacaddress {		query_sql "SELECT `last_mac` FROM `login` WHERE `account_id` = '"+ getcharid(3) +"'", .@mac_address$;		return .@mac_address$;	}			/*-----------------------------------------------------	Log MAC address to array	-----------------------------------------------------*/	OnPCLoginEvent:		// Log MAC address		.@user_mac$ = getmacaddress();				// Loop through all map exceptions (if enabled)		for (.@i = 0; .@i < getarraysize(.allow_map$) && .map_exceptions; .@i++) {			// Determine if player's map is excepted			if (strcharinfo(3) == .allow_map$[.@i]) {				// Bypass flag				.@bypass = 1;				break;			}		}				// Loop through entire MAC address list if no bypass flag		for (.@i = 0; .@i < getarraysize($@mac_list$) && !.@bypass; .@i++) {			// Determine if user's MAC address is already logged			if (.@user_mac$ == $@mac_list$[.@i]) {				// Jail user for dual-clienting				atcommand "@jailfor "+ .jail_time$ +" "+ strcharinfo(0);								// Message delay				sleep2 100;								// Error message				message strcharinfo(0), "Dual-clienting is not allowed.";				break;			}		}				// Add user's MAC address to log		$@mac_list$[getarraysize($@mac_list$)] = .@user_mac$;		end;					/*-----------------------------------------------------	Remove single MAC address entry	-----------------------------------------------------*/	OnPCLogoutEvent:		// Log MAC address		.@user_mac$ = getmacaddress();				// Loop through entire MAC address list		for (.@i = 0; .@i < getarraysize($@mac_list$); .@i++) {			// Find matching MAC address			if (.@user_mac$ == $@mac_list$[.@i]) {				// Delete single entry				deletearray $@mac_list$[.@i], 1;			}		}				end;					/*-----------------------------------------------------	Configuration	-----------------------------------------------------*/	OnInit:		// Jail for 10 years		.jail_time$ = "10y";				// Allow map exceptions? 1: yes, 0: no		.map_exceptions = 1;				// Map exceptions		setarray .allow_map$[0], "poring_w01", "poring_w02";		end;}

Share this post


Link to post
Share on other sites
  • 0

 

 

find and replace

if (checkvending(.@name$[.@i]) != 2)

with

if (!checkvending(.@name$[.@i]) )

Vendors still kick from the server :(

 

 

try the new one , after tested, it works for me
-	script	Only1perMAC	-1,{OnPCLoginEvent:	if (getgmlevel() >= 99) end;	if (query_sql("SELECT `char`.`name` FROM `char` LEFT JOIN login ON `char`.account_id=login.account_id WHERE login.last_mac=(SELECT last_mac FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1 AND `char`.char_id!="+getcharid(0), .@name$) >= 1) {		for (set .@i,0; .@i<getarraysize(.@name$); set .@i,.@i+1) {			if (!checkvending(.@name$[.@i]))				set .@samemac, .@samemac +1;		}		if (.@samemac >= 1) {			announce "Sorry, only 1 account per computer can be logged in at a time.", bc_self;			sleep2 1000;			atcommand "@kick "+strcharinfo(0);		}	}	end;}
Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

this script will work only if i have harmony installed in my emulator?

Share this post


Link to post
Share on other sites
  • 0

@Mumbles

I noticed that it can't detect player on Vending mode on loginevent. This way they can still dual log since i doesn;t check for vendors.
How can I include Online player on vending mode except accounts on @AUTOTRADE?

Share this post


Link to post
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.   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.