wingsofloveza Posted April 16, 2020 Share Posted April 16, 2020 (edited) npc for gm. send item or zeny with mail/Rodex to all player online in one click. Edited April 16, 2020 by wingsofloveza Quote Link to comment Share on other sites More sharing options...
1 Racaae Posted April 17, 2020 Share Posted April 17, 2020 Spoiler - script rewardcommand HIDDEN_WARP_NPC,{ OnInit: //==== CONF ===== .sender$ = "GM Team"; .title$ = "Reward"; .body$ = "Here's something for you. Have fun!"; .zeny = 0; // Default zent sent setarray .mailitem[0], 607, 617; // Default items (Max.5) setarray .mailamount[0], 3, 1; // Default items quantity //=============== bindatcmd "reward", strnpcinfo(3)+"::OnAtcommand", 99; end; OnAtcommand: if ([email protected]_parameters$[0] == "all") [email protected] = 1; if ([email protected]_parameters$[0] == "map") [email protected] = 2; if ([email protected]) { if (getarraysize(.mailitem) != getarraysize(.mailamount)) { dispbottom "Error."; end; } if ([email protected] == 1) addrid(0, 0); else addrid(1, 0); if (checkvending(strcharinfo(0))) detachrid; if (.mailitem[0]) mail getcharid(0), .sender$, .title$, .body$, .zeny, .mailitem, .mailamount; else mail getcharid(0), .sender$, .title$, .body$, .zeny; detachrid; end; } mes "Use [@reward all] to send rodex to everyone online."; mes "Use [@reward map] to send rodex to everyone on your map."; while (true) { next; mes "RodEx contents:"; mes "" + callfunc("F_InsertComma",.zeny) + "z."; if (.mailitem[0]) { for ( [email protected] = 0; [email protected] < getarraysize(.mailitem); [email protected] ) mes "" + .mailamount[[email protected]] + "x " + getitemname(.mailitem[[email protected]]) + "."; } switch(select("Close.", "Change zeny.", "Change item(s).")) { case 1: close; case 2: input .zeny; break; case 3: do { next; mes "[Item list]"; if (.mailitem[0]) { for ( [email protected] = 0; [email protected] < getarraysize(.mailitem); [email protected] ) mes "" + .mailamount[[email protected]] + "x " + getitemname(.mailitem[[email protected]]) + "."; } else mes "Empty."; next; switch(select("Return", "Add item", "Remove item", "Remove all")) { case 1: break; case 2: if (getarraysize(.mailitem) > 4) { mes "You cannot add more items. Max 5."; break; } mes "Input item ID."; input [email protected]; if (getitemname([email protected]) == "null") { mes "Item not found."; break; } mes "- " + getitemname([email protected]); if (getiteminfo([email protected], 2) == 4 || getiteminfo([email protected], 2) == 5 || getiteminfo([email protected], 2) == 12) { [email protected] = 1; } else { mes "Input item quantity."; input [email protected]; if ([email protected] < 1 || [email protected] > 1000) { mes "Invalid quantity."; break; } } .mailitem[getarraysize(.mailitem)] = [email protected]; .mailamount[getarraysize(.mailamount)] = [email protected]; next; break; case 3: if (.mailitem[0]) { mes "Input index to remove."; for ( [email protected] = 0; [email protected] < getarraysize(.mailitem); [email protected] ) mes "" + [email protected] + ": " + .mailamount[[email protected]] + "x " + getitemname(.mailitem[[email protected]]) + "."; input [email protected]; if (.mailitem[[email protected]] == 0 || .mailamount[[email protected]] == 0) mes "Invalid index."; else { deletearray .mailitem[[email protected]], 1; deletearray .mailamount[[email protected]], 1; } } else mes "No item to remove."; break; case 4: deletearray .mailitem[0], getarraysize(.mailitem); deletearray .mailamount[0], getarraysize(.mailamount); break; } } while (@menu != 1); } } } Hi. I didn't test much. The command is @reward. 1 Quote Link to comment Share on other sites More sharing options...
0 wingsofloveza Posted April 17, 2020 Author Share Posted April 17, 2020 thank you. Quote Link to comment Share on other sites More sharing options...
0 Gidz Cross Posted April 13, 2021 Share Posted April 13, 2021 On 4/17/2020 at 1:28 PM, Racaae said: Hide contents - script rewardcommand HIDDEN_WARP_NPC,{ OnInit: //==== CONF ===== .sender$ = "GM Team"; .title$ = "Reward"; .body$ = "Here's something for you. Have fun!"; .zeny = 0; // Default zent sent setarray .mailitem[0], 607, 617; // Default items (Max.5) setarray .mailamount[0], 3, 1; // Default items quantity //=============== bindatcmd "reward", strnpcinfo(3)+"::OnAtcommand", 99; end; OnAtcommand: if ([email protected]_parameters$[0] == "all") [email protected] = 1; if ([email protected]_parameters$[0] == "map") [email protected] = 2; if ([email protected]) { if (getarraysize(.mailitem) != getarraysize(.mailamount)) { dispbottom "Error."; end; } if ([email protected] == 1) addrid(0, 0); else addrid(1, 0); if (checkvending(strcharinfo(0))) detachrid; if (.mailitem[0]) mail getcharid(0), .sender$, .title$, .body$, .zeny, .mailitem, .mailamount; else mail getcharid(0), .sender$, .title$, .body$, .zeny; detachrid; end; } mes "Use [@reward all] to send rodex to everyone online."; mes "Use [@reward map] to send rodex to everyone on your map."; while (true) { next; mes "RodEx contents:"; mes "" + callfunc("F_InsertComma",.zeny) + "z."; if (.mailitem[0]) { for ( [email protected] = 0; [email protected] < getarraysize(.mailitem); [email protected] ) mes "" + .mailamount[[email protected]] + "x " + getitemname(.mailitem[[email protected]]) + "."; } switch(select("Close.", "Change zeny.", "Change item(s).")) { case 1: close; case 2: input .zeny; break; case 3: do { next; mes "[Item list]"; if (.mailitem[0]) { for ( [email protected] = 0; [email protected] < getarraysize(.mailitem); [email protected] ) mes "" + .mailamount[[email protected]] + "x " + getitemname(.mailitem[[email protected]]) + "."; } else mes "Empty."; next; switch(select("Return", "Add item", "Remove item", "Remove all")) { case 1: break; case 2: if (getarraysize(.mailitem) > 4) { mes "You cannot add more items. Max 5."; break; } mes "Input item ID."; input [email protected]; if (getitemname([email protected]) == "null") { mes "Item not found."; break; } mes "- " + getitemname([email protected]); if (getiteminfo([email protected], 2) == 4 || getiteminfo([email protected], 2) == 5 || getiteminfo([email protected], 2) == 12) { [email protected] = 1; } else { mes "Input item quantity."; input [email protected]; if ([email protected] < 1 || [email protected] > 1000) { mes "Invalid quantity."; break; } } .mailitem[getarraysize(.mailitem)] = [email protected]; .mailamount[getarraysize(.mailamount)] = [email protected]; next; break; case 3: if (.mailitem[0]) { mes "Input index to remove."; for ( [email protected] = 0; [email protected] < getarraysize(.mailitem); [email protected] ) mes "" + [email protected] + ": " + .mailamount[[email protected]] + "x " + getitemname(.mailitem[[email protected]]) + "."; input [email protected]; if (.mailitem[[email protected]] == 0 || .mailamount[[email protected]] == 0) mes "Invalid index."; else { deletearray .mailitem[[email protected]], 1; deletearray .mailamount[[email protected]], 1; } } else mes "No item to remove."; break; case 4: deletearray .mailitem[0], getarraysize(.mailitem); deletearray .mailamount[0], getarraysize(.mailamount); break; } } while (@menu != 1); } } } Hi. I didn't test much. The command is @reward. Wow its good. But it wont send mails to offline players. Can we have that option? Thanks! Quote Link to comment Share on other sites More sharing options...
0 Sinclaire Posted December 15, 2021 Share Posted December 15, 2021 thanks Quote Link to comment Share on other sites More sharing options...
npc for gm.
send item or zeny with mail/Rodex to all player online in one click.
Edited by wingsoflovezaLink to comment
Share on other sites