Jump to content
  • 0
mrlongshen

Custom Display @command

Question

Hi all.

When player type @commands, it will show what we have config in group.conf right ? 

How to add additional display custom command in there ? at the bottom below of the original.

 

For example:

Custom command ----

buff,rms,ii2,jump2

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

To add the custom commands to '@commands', you'll have to make a change in the source, if you want do to in script, you have to create a command using the function 'bindatcmd' (see more in 'doc/script_commands.txt') and put your custom commands.

 

If you want the source modification example.

Here is:

atcommand.c.patch

 

Sorry for my english, I only understand a little of english. :)

Share this post


Link to post
Share on other sites
  • 0

Put '@commands2' in chat to see the custom commands.

This is a little example...

Here is:

 

 

 

-    script    atcmd_example    FAKE_NPC,{
OnInit:
    setarray .custom_commands$[0], "buff", "rms", "ii2", "jump2";
    setarray .custom_commands_group[0], 3, 0, 10, 15;
 
    bindatcmd "commands2", strnpcinfo(3) + "::OnAtcommand";
    end;
 
OnAtcommand:
    message getcharid(3), "--------------------------";
    message getcharid(3), "Available custom commands:";
 
    for(.@i = 0; .@i < getarraysize(.custom_commands$); .@i++)
    {
        if (getgroupid() < .custom_commands_group[.@i])
            continue;
 
        .@commands_string$ += .custom_commands$[.@i] + ((.@i + 1 == getarraysize(.custom_commands$)) ? "" : "   "); 
        .@count++;
    }
 
    message getcharid(3), .@commands_string$;
    message getcharid(3), .@count + " custom commands found.";
    end;
}

 

 

Share this post


Link to post
Share on other sites
  • 0

@@Cretino Oh I see. Thanks for your help sir ! I wish one day you will become herc.ws source dev  :wub:

 

Hello friend, was seeing something in the function 'bindatcmd' and I made a change that I think you will like it, you will only need apply this change and all script commands will be read and show together in '@commands'.

 

atcommand.c_v2.patch

Share this post


Link to post
Share on other sites
  • 0

 

@@Cretino Oh I see. Thanks for your help sir ! I wish one day you will become herc.ws source dev  :wub:

 

Hello friend, was seeing something in the function 'bindatcmd' and I made a change that I think you will like it, you will only need apply this change and all script commands will be read and show together in '@commands'.

 

attachicon.gifatcommand.c_v2.patch

@@Cretino thx a loot bro

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.