Limit characters in 1 MAP

karazu

New member
Messages
1,115
Points
0
Hello, My server is getting bigger.  And I have noticed that some of the players are making 3-5 accounts or more in the vending area, is there any way in stopping them doing that?

I have a script here it was requested months ago, so is this possible or can detect vendors?
 

What I want with the script is if the player already have 3 vendors in the area he cannot go there anymore if he wants to put more merchants.




Is that possible?

Code:
-	script	dualclientkicker	-1,{OnPCLoadMapEvent:    set .@charmap$, strcharinfo(3);    if(!compare(.tmp$,.@charmap$)) end;   set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE`account_id` IN (SELECT `account_id` FROM `login` WHERE `last_ip` =(SELECT `last_ip` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND`online` <> 0;",.@a);    for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {        if(!getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])) && .@charmap$==.@map$)            set .@c,.@c+ 1;     }    if(.@c > .limitacc ) {            dispbottom "You cannot more than 5 accounts in this map.";             warp "prontera",0,0;    }    end;    OnInit:     set .limitacc,5;    setarray .maps$,"prontera", "geffen";        set .lens ,    getarraysize(.maps$) ;        for(set(.a,0);.a<.lens;set(.a,.a+1)) {            setmapflag .maps$[.a],    mf_loadevent ;            set .tmp$ ,.tmp$+.maps$[.a]+",";        }} 
 
add this condition into you mysql query, thus @at vendor will not be counted

Code:
AND `account_id` NOT IN (SELECT `account_id` FROM `autotrade_merchants`)
 
add this condition into you mysql query, thus @at vendor will not be counted

AND `account_id` NOT IN (SELECT `account_id` FROM `autotrade_merchants`)
Hello Angel, What I want is to limit the Vendors in the area.

so if the player already have 3 vendors in the area and if he got another who wants to go to the map it will be kicked back to prontera.

 
add this condition into you mysql query, thus @at vendor will not be counted

AND `account_id` NOT IN (SELECT `account_id` FROM `autotrade_merchants`)
Hello Angel, What I want is to limit the Vendors in the area.

so if the player already have 3 vendors in the area and if he got another who wants to go to the map it will be kicked back to prontera.
Sorry,I have no idea how to limit dynamic-ip player to set up  a vendor

 
that script came from here

http://rathena.org/board/topic/84477-dual-client-kick-at-same-map/?p=237480

honestly that script is unoptimized

use mine ... -> something like this

Code:
-	script	auto_kicker	-1,{OnPCLoadMapEvent:	.@limit = 4; // on 4th account will be warp away	if ( strcharinfo(3) == "prontera" ) {		query_sql "select count(1) from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'", .@count;		if ( .@count >= .@limit ) {			dispbottom "you cannot have more than "+ .@limit +" accounts in this map";			warp "geffen", 0,0;			end;		}	}	end;}prontera	mapflag	loadevent
EDIT: this script doesn't detect vendors but able to detect multi-client users
 
Last edited by a moderator:
that script came from here

http://rathena.org/board/topic/84477-dual-client-kick-at-same-map/?p=237480

honestly that script is unoptimized

use mine ... -> something like this

- script auto_kicker -1,{OnPCLoadMapEvent: .@limit = 4; // on 4th account will be warp away if ( strcharinfo(3) == "prontera" ) { query_sql "select count(1) from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'", .@count; if ( .@count >= .@limit ) { dispbottom "you cannot have more than "+ .@limit +" accounts in this map"; warp "geffen", 0,0; end; } } end;}prontera mapflag loadeventEDIT: this script doesn't detect vendors but able to detect multi-client users
Thank you for this.

I think Vendor control could not be possible..

 
I think Vendor control could not be possible..
actually possible with source modifications
inside skill.c

when use vending skill

loop through all online players and search if ( sd->ip_address == pl_sd->ip_address && !strcmp( sd->mapindex, "prontera" ) ) i++;

if ( i >= 4 ) return false; // cannot use vending skill

something like that

but lazy to do hahaha

 
Last edited by a moderator:
the above script only check online player, it didn't check the player is doing no matter what

so @afk should be able to detect

 
Back
Top