Jump to content
  • 0

Q>How to Disable Same ip in certain maps


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

hello i would like to ask for help i want to disable ip in this certain pvp maps i search but its not working can someone help me 

 

Quote

    // https://rathena.org/board/topic/107986-requesting-for-a-pvp-ranking-w-reset/

/*
ALTER TABLE `char` ADD `pvp_kill` INT(11) UNSIGNED NOT NULL DEFAULT '0'  AFTER `fame`;
*/

payon,171,222,4    script    PVP Warper    630,{
    doevent "pvp_rank_main::OnTalk";
}

-    script    pvp_rank_main    -1,{

    OnTalk:
        mes "[PvP Room Master]";
        mes "Where do you wanna go?";
        next;
        switch ( select ( 
            "Valkyrie [ "+getmapusers("valkyrie_vs")+" ]",
            "Izlude [ "+getmapusers("pvp_y_1-2")+" ]",
            "Prontera [ "+getmapusers("prt_pvp")+" ]",
            "Death Match [ "+getmapusers("bat_cc2")+" ]",
//            "PVP Ranking",
            ( getgmlevel() >= 99 ) ? "^FF0000[GM] Reset PVP Ranking^000000":""
        )) {
    case 1:    // vakyrie
        if (getmapusers("valkyrie_vs") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "valkyrie_vs",0,0;
        announce ""+strcharinfo(0)+" entered Valkyrie PVP ROOM !",bc_all,0xCCFFFF;
        end;
        
    case 2:    // Izlude PVP Room
        if (getmapusers("pvp_y_1-2") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "pvp_y_1-2",0,0;
        announce ""+strcharinfo(0)+" entered Izlude PVP ROOM !",bc_all,0xCCFFFF;
        end;
        
    case 3:    // Prontera PVP Rooom
        if (getmapusers("prt_pvp") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }
        warp "prt_pvp",0,0;
        announce ""+strcharinfo(0)+" entered Prontera PVP ROOM !",bc_all,0xCCFFFF;
        end;

    case 4:    // Death Match Arena
        if (getmapusers("bat_cc2") > 99) callsub S_full;
        if (BaseLevel <98) { 
        mes "Excuse me, but";
        mes "did you not come prepared?";
        mes "you need to be";
        mes "atleast level 98 above!";
        close;
        }    
        warp "bat_cc2",0,0;
        announce ""+strcharinfo(0)+" entered Death Match Arena !",bc_all,0xCCFFFF;
        end;
        
            default:
                mes "[PvP Room Master]";
                mes "PVP Ranking";
                query_sql( "SELECT `name`,`pvp_kill` FROM `char` WHERE `pvp_kill` > 0 ORDER BY `pvp_kill` DESC LIMIT 10", .@name$, .@pvp_kill );
                .@size = getarraysize( .@name$ );
                for ( .@i = 0; .@i < .@size; .@i++ ) {
                    mes "["+(.@i + 1 )+"] "+.@name$[.@i]+" - "+.@pvp_kill[.@i]+" kill(s)";
                }
                break;
            case 5:
                mes "[PvP Room Master]";
                mes "Reset Ranking? Action cant be undo. Confirm your action.";
                if ( select( "Confirm","Cancel" ) == 1 ) {
                    query_sql( "UPDATE `char` SET `pvp_kill` = 0 WHERE `pvp_kill` > 0" );
                    mes "Done.";
                }
                break;
        }
        close;
    
    L_Enter:
        .@title$ = getarg( 0,"" );
        .@map$ = getarg( 1,"" );
        .@max_player = getarg( 2,0 );
        .@getmapusers = getmapusers( .@map$ );
        
        mes "[PvP Room Master]";
        if ( .@getmapusers == -1 ) {
            mes "Invalid map.";
        }
        else if ( .@max_player > 0 && .@getmapusers >= .@max_player ) {
            mes "I'm sorry but the PVP Room is already full!";
        }
        else {
            mes .@title$ + " ["+.@getmapusers+"/"+.@max_player+"]";
            if ( select( "Enter" ) == 1 ) {
                warp .@map$,0,0;
            }
        }
        return;
        
    OnPCKillEvent:
        if ( getcharid(3) != killedrid ) {
            query_sql( "UPDATE `char` SET `pvp_kill` = `pvp_kill` + 1 WHERE `char_id` = "+getcharid(0)+" LIMIT 1" );
        }
        end;
}


// PvP Room ----------------------------------------------

prontera,149,197,5    duplicate(PVP Warper)    PVP Warper#prt1    630 
payon,178,112,4    duplicate(PVP Warper)    PVP Warper#pay    630
bg_lobby,48,54,5    duplicate(PVP Warper)    PVP Warper#bgl    630
//morocc,162,101,4    duplicate(PVP Warper)    PVP Warper#mrc    630
//geffen,124,68,4    duplicate(PVP Warper)    PVP Warper#gef    630
//alberta,32,238,5    duplicate(PVP Warper)    PVP Warper#alb    630
//izlude,134,96,4    duplicate(PVP Warper)    PVP Warper#izl    630
//aldebaran,145,113,4    duplicate(PVP Warper)    PVP Warper#ald    630
//payon,171,217,4    duplicate(PVP Warper)    PVP Warper#pay23    630 630zzzz

prontera,165,92,4    duplicate(PVP Warper)    PVP Warper#prt    630 
prt_fild08,166,370,5    duplicate(PVP Warper)    PVP Warper#prtf    630

 

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1188
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

11 hours ago, GM Winter said:

hello i would like to ask for help i want to disable ip in this certain pvp maps i search but its not working can someone help me 

 

 

try dual client kicker script.

you can try script in this link

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

21 minutes ago, hendra814 said:

try dual client kicker script.

you can try script in this link

thank you but ,it didnt work

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1188
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

2 hours ago, GM Winter said:
2 hours ago, hendra814 said:

try dual client kicker script.

you can try script in this link

thank you but ,it didnt work

can you show the error/issue?

please make sure your map already put in the array list

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

1 hour ago, hendra814 said:

can you show the error/issue?

please make sure your map already put in the array list

yes sir i already add the maps in the list

 

Quote

-    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);
    //set .@len, query_sql("select account_id from `char` right join login on login.account_id = `char`.account_id where `char`.online = 1 and login.last_ip = '"+ getcharip() +"'",.@a ); //Annieruru Addition.
    if(.@len-1) {
        for(set(.@d,0);.@d<.@len;set(.@d,.@d+1)) {
            getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d]));
            if(.@charmap$==.@map$&&rid2name(.@a[.@d])!=strcharinfo(0)) {
                dispbottom "No se permite doble login.";
                warp "geffen",0,0;
            }
        }
    }
    end;
    
OnInit:
    setarray   .maps$  ,    "valkyrie_vs", "pvp_y_1-2", "prt_pvp", "bat_cc2";
    set        .lens   ,    getarraysize(.maps$)                                   ;
    for(set(.a,0);.a<.lens;set(.a,.a+1)) {
        setmapflag .maps$[.a],    mf_loadevent ;
        set .tmp$  ,.tmp$+.maps$[.a]+",";
    }
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1188
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

38 minutes ago, GM Winter said:

yes sir i already add the maps in the list

 

 

try use this

-	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 "Dual accounts not allowed in PVP.";
	warp "geffen",0,0;
	}    
	end;
OnInit:
set .limitacc,1;
setarray .maps$, "valkyrie_vs", "pvp_y_1-2", "prt_pvp", "bat_cc2";
set .lens ,    getarraysize(.maps$) ;
for(set(.a,0);.a<.lens;set(.a,.a+1)) {
	setmapflag .maps$[.a],    mf_loadevent ;
	set .tmp$ ,.tmp$+.maps$[.a]+",";
}
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

Posted (edited)
6 hours ago, hendra814 said:

try use this

-	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 "Dual accounts not allowed in PVP.";
	warp "geffen",0,0;
	}    
	end;
OnInit:
set .limitacc,1;
setarray .maps$, "valkyrie_vs", "pvp_y_1-2", "prt_pvp", "bat_cc2";
set .lens ,    getarraysize(.maps$) ;
for(set(.a,0);.a<.lens;set(.a,.a+1)) {
	setmapflag .maps$[.a],    mf_loadevent ;
	set .tmp$ ,.tmp$+.maps$[.a]+",";
}
}

 

still not working sir i also got this errors

 

Quote

[Error]: buildin_rid2name: invalid RID
[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): dualclientkicker (invisible/not on a map)
[Error]: buildin_rid2name: invalid RID
[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): dualclientkicker (invisible/not on a map)
[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): dualclientkicker (invisible/not on a map)
[Error]: buildin_rid2name: invalid RID
[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): dualclientkicker (invisible/not on a map)
[Warning]: script: buildin_getmapxy: Invalid type 0.
[Debug]: Source (NPC): dualclientkicker (invisible/not on a map)

 

Edited by GM Winter
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1188
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

3 hours ago, GM Winter said:

still not working sir i also got this errors

 

 

same issue, need to fix the script.

image.png.5da50f68e87db7aad5e27adac924f3c4.png

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

6 minutes ago, hendra814 said:

same issue, need to fix the script.

image.png.5da50f68e87db7aad5e27adac924f3c4.png

anyways thank you for your effort sir

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

  • 0

  • Group:  Members
  • Topic Count:  55
  • Topics Per Day:  0.01
  • Content Count:  1188
  • Reputation:   161
  • Joined:  06/12/12
  • Last Seen:  

14 hours ago, Rynbef said:

Already change form

if(!getmapxy(.@map$,.@x,.@y,0,rid2name(.@a[.@d])) && .@charmap$==.@map$)

into

if(!getmapxy(.@map$,.@x,.@y,0,BL_PC)) && .@charmap$==.@map$)

but still have waning and can use dual clent in the same map

image.png.82833ff848672d8e97dbde7bf8ef61ed.png

 

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  896
  • Reputation:   117
  • Joined:  05/23/12
  • Last Seen:  

if(!getmapxy(.@map$,.@x,.@y,BL_PC,rid2name(.@a[.@d])) && .@charmap$==.@map$)

 

Rynbef~

Edited by Rynbef
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

21 minutes ago, Rynbef said:
if(!getmapxy(.@map$,.@x,.@y,BL_PC,rid2name(.@a[.@d])) && .@charmap$==.@map$)

 

Rynbef~

got this error1.png.68aa2800575ca3d8d94e762446fa5ac3.png

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