IsabelaFernandez Posted December 28, 2023 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
0 Winterfox Posted December 28, 2023 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
0 IsabelaFernandez Posted December 28, 2023 Author 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
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;
}
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.