IsabelaFernandez Posted December 28, 2023 Group: Members Topic Count: 145 Topics Per Day: 0.07 Content Count: 354 Reputation: 8 Joined: 04/16/18 Last Seen: January 4 Share Posted December 28, 2023 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; } Quote Link to comment Share on other sites More sharing options...
0 Winterfox Posted December 28, 2023 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 232 Reputation: 86 Joined: 06/30/18 Last Seen: 11 hours ago Share Posted December 28, 2023 (edited) 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 December 28, 2023 by Winterfox 1 Quote Link to comment Share on other sites More sharing options...
0 IsabelaFernandez Posted December 28, 2023 Group: Members Topic Count: 145 Topics Per Day: 0.07 Content Count: 354 Reputation: 8 Joined: 04/16/18 Last Seen: January 4 Author Share Posted December 28, 2023 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 Quote Link to comment Share on other sites More sharing options...
Question
IsabelaFernandez
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:
- 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.