Jump to content
  • 0

restricted area


Question

Posted (edited)

Hi guys,

 

 I have here my farm zone script, the room is capable only for 5 players.

Can you add on the script that it will automatically kick players who is AFK for more than 5 mins.

farm_zone.txt

Edited by Patskie
Topic merged ( http://rathena.org/board/topic/90077-restricted-area/#entry234078 )

7 answers to this question

Recommended Posts

Posted

Untested:

// Just change map whatever you want
prontera,147,158,5	script	Farm Zone	900,{
    mes "This is a Farm Zone.";
    mes "You will be able to hunt Budots Coin inside this Room.";
    mes "But please be careful, this room is PK Enabled.";
next;
    menu "Are you sure to go? [" + getmapusers("bat_c01.gat") +"/5]", L_Go, "Nevermind", L_nvm;
 
L_Go:
next;
if (getmapusers("bat_c01") >= 5) {
mes "This map is currently full.";
close;
}
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
warp "bat_c01",55,119;
end;
 
L_nvm:
mes "No problem come back again";
close;
end;

OnTimerQuit:
detachnpctimer;
end;

OnTimer10000:
getmapxy( .@map$, .@x, .@y, 0 );
if ((@map$ == .@map$) && (@x == .@x) && (@y == .@y)) { set @afk, @afk + 1; }
else { set @afk, 0; }
if (@map$ != "bat_c01") { detachnpctimer; }
set @map$, .@map$; set @x, .@x; set @y, .@y;
if (@afk >= 30) {
    dispbottom "You have been kicked from the room because you have been AFK for 5 minutes.";
    detachnpctimer;
    warp "SavePoint",0,0;
    end;
}
initnpctimer;
}
// --------------------------------------------------------------
-	script	Monsters	-1,{
OnInit:
OnNPCKillEvent:
if ( strcharinfo(3) == "bat_c01" ) {
if( killedrid == 1369){
    getitem 9524,1;
}
end;
}
}


bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
bat_c01,0,0,52,52	monster	Am Mut	1301,20,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,10,40000,20000;
bat_c01,0,0,52,52	monster	Am Mut	1301,10,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,10,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,10,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
Posted

Untested:

// Just change map whatever you want
prontera,147,158,5	script	Farm Zone	900,{
    mes "This is a Farm Zone.";
    mes "You will be able to hunt Budots Coin inside this Room.";
    mes "But please be careful, this room is PK Enabled.";
next;
    menu "Are you sure to go? [" + getmapusers("bat_c01.gat") +"/5]", L_Go, "Nevermind", L_nvm;
 
L_Go:
next;
if (getmapusers("bat_c01") >= 5) {
mes "This map is currently full.";
close;
}
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
warp "bat_c01",55,119;
end;
 
L_nvm:
mes "No problem come back again";
close;
end;

OnTimerQuit:
detachnpctimer;
end;

OnTimer10000:
getmapxy( .@map$, .@x, .@y, 0 );
if ((@map$ == .@map$) && (@x == .@x) && (@y == .@y)) { set @afk, @afk + 1; }
else { set @afk, 0; }
if (@map$ != "bat_c01") { detachnpctimer; }
set @map$, .@map$; set @x, .@x; set @y, .@y;
if (@afk >= 30) {
    dispbottom "You have been kicked from the room because you have been AFK for 5 minutes.";
    detachnpctimer;
    warp "SavePoint",0,0;
    end;
}
initnpctimer;
}
// --------------------------------------------------------------
-	script	Monsters	-1,{
OnInit:
OnNPCKillEvent:
if ( strcharinfo(3) == "bat_c01" ) {
if( killedrid == 1369){
    getitem 9524,1;
}
end;
}
}


bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
bat_c01,0,0,52,52	monster	Am Mut	1301,20,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,10,40000,20000;
bat_c01,0,0,52,52	monster	Am Mut	1301,10,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,10,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,10,40000,20000;
bat_c01,0,0,52,52	monster	Grand Peco	1369,20,40000,20000;

Wait lemme try

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...