Jump to content
  • 0

custom command #


IsabelaFernandez

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

Hi everyone. currently my script only works with @. I would like it to work so I can send it to another player, that is, with the introduction of the #. Could any of the script masters help me with my script?

My Script:

Spoiler

-    script    atcmd_example    -1,{
OnInit:
    bindatcmd("rentitem", strnpcinfo(3)+"::OnAtcommand");
    end;
OnAtcommand:
    .@itemid = atoi(.@atcmd_parameters$[0]);
    if (getitemname(.@itemid) != "null") {
        if (getiteminfo(.@itemid, 2) != IT_CARD) {
            rentitem .@itemid, (24 * 60 * 60); // 1 day
        }
        else {
            dispbottom .@atcmd_command$+" - You cant rent "+getitemname(.@itemid);
        }
    }
    else {
        dispbottom .@atcmd_command$+" - invalid item #"+.@itemid;
    }
    end;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

You can use the last parameter of bindatcmd. The default of charcommand level is 100 so that it basically is disabled by default. If you set it to a group level someone has, you should be able to use that command like a char command.

bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};

 

Edited by Winterfox
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

5 hours ago, Winterfox said:

You can use the last parameter of bindatcmd. The default of charcommand level is 100 so that it basically is disabled by default. If you set it to a group level someone has, you should be able to use that command like a char command.

bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};

 

worked, thank you!
Another question, how do I receive a message that the item has been created? with @ it normally appears "item created" but with # it does not appear, although it is working

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