Jump to content
  • 0

@afk command mod


uDe

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  


-    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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

BUMP.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

BUMP

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

BUMP

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

yes, .mindistance  was for set  the distance from NPC.

 

array  .npcnamelist$ was for set wihich npc  you dont allow player to block when use @afk

 

I  updated my script  ,   try again

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

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?

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