Jump to content
  • 0
karazu

Limit characters in 1 MAP

Question

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?

-	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]+",";        }} 

 

 

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

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`)

Share this post


Link to post
Share on other sites
  • 0

 

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.

 

 

Share this post


Link to post
Share on other sites
  • 0

 

 

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

Share this post


Link to post
Share on other sites
  • 0

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	loadevent
EDIT: this script doesn't detect vendors but able to detect multi-client users Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

 

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	loadevent
EDIT: 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..

 

 

Share this post


Link to post
Share on other sites
  • 0

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

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

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

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.