Jump to content
  • 0

@afk command mod


Question

Posted

Hello guys..

 

@afk command source : http://rathena.org/board/topic/71389-afk-with-afk-hat/

 

May I ask some modification for this source?

 

When I use @afk, I need it to automatically create a chatroom with title "Away from keyboard" (default) in order to prevent the players to just type @afk without open any chatroom.

 

Why do I need this? It's because players still trying to block NPC while they "afk" and I had set chatroom range from NPC. So with this modification, I hope that the players can't block any NPC anymore after this because they can't create chatroom around NPC.

 

Thank you.

7 answers to this question

Recommended Posts

Posted (edited)


-    script    test123456    -1,{

end;

OnInit:

    .mindistance=3;

    setarray .npcnamelist$[0],"aaaa","bbbb","CCC";

    bindatcmd "afk", strnpcinfo(0)+"::OnAFK";

    end;

OnAFK:

    .@size=getarraysize(.npcnamelist$);

    getmapxy(.@mp$,.@mpx,.@mpy,0);

    for(;.@i<.@size;.@i++){

        if(!getmapxy(.@mn$,.@mnx,.@mny,1,.npcnamelist$[.@i])){

            if( distance(.@mpx,.@mpy,.@mnx,.@mny) < .mindistance){

                dispbottom " you can't use @afk command ,cause You're too near the npc";

                end;

            }

        }

    }

      

    atcommand "@afk";

    end;

}

Edited by QQfoolsorellina
  • Upvote 1
Posted (edited)

Thanks for the reply. But I still can use @afk cmd around NPC.

 

[06/Jul 22:28][Info]: Character '[ADMIN] Helper' logged off (using @autotrade).

that's on map-server. Is normal if the server tells me that? Even I'm using @afk, not @at/@autotrade.

 

Questions :

 

    .mindistance=5;

That was for set the distance from NPC right?

 

        setarray .npcnamelist$[0],"aaaa","bbbb","CCC";

I've no idea for that. What's that?

Edited by uDe
Posted

Okay, seems like it can be use now. So, for .npcnamelist$ , I need too list the most important NPC at town right? But, how about duplicate NPC? Do I need to write down the full name like in the script? Example, Buffer#prontera . Like that?

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