if you use sql db then @reloaditemdb works. you just need to relog or else it won't update.
prontera,164,174,3 script CS Manager 510,{
//NPC Name
set .npcname$, "Cash Shop";
mes "[^00AAAA"+.npcname$+"^000000]";
mes "Welcome to the ^00AAAACash Shop^000000!";
if (getgmlevel() == 99){
menu "Add Cash Item",AddCash,"Remove Cash Item",RemoveCash,"View Cash Items",ViewCash;} else {
menu "View Cash Items",ViewCashPlayer;}
AddCash:
next;
mes "[^00AAAA"+.npcname$+"^000000]";
mes "Please input the following Variables:";
mes "Cash Type, Item ID, Price";
mes "[Types]","New: 0","Hot: 1","Limited: 2","Rental: 3","Equipment: 4","Scrolls: 5","Consumable: 6","Miscellaneous: 7";
input .@Type$;
input .@ItemID$;
input .@Price$;
query_sql("INSERT INTO `ragnarok`.`item_cash_db` (`tab`, `item_id`, `price`) VALUES ('"+.@Type$+"', '"+.@ItemID$+"', '"+.@Price$+"')");
atcommand "@reloaditemdb";
next;
mes "[^00AAAA"+.npcname$+"^000000]";
mes "Alrighty! I think that worked~ Just relog to see if it worked.";
close;
RemoveCash:
next;
mes "[^00AAAA"+.npcname$+"^000000]";
mes "Please input the following Variables:";
mes "Cash Type and Item ID";
mes "[Types]","New: 0","Hot: 1","Limited: 2","Rental: 3","Equipment: 4","Scrolls: 5","Consumable: 6","Miscellaneous: 7";
input .@Type$;
input .@ItemID$;
query_sql("DELETE FROM `ragnarok`.`item_cash_db` WHERE `tab`='"+.@Type$+"' and `item_id`='"+.@ItemID$+"';");
atcommand "@reloaditemdb";
next;
mes "[^00AAAA"+.npcname$+"^000000]";
mes "Alrighty! I think that worked~ Just relog to see if it worked.";
close;
ViewCash:
next;
next;
mes "[^00AAAA"+.npcname$+"^000000]";
mes "[^00AA00Type^000000] [^00AAAAItem Name^000000]";
for( .@i = 0; .@i < .num_items; .@i++ )
mes "[^00AA00"+.tab[.@i]+"^000000] [^00AAAA"+getitemname(.itemid[.@i])+"^000000]("+.itemid[.@i]+")";
close;
ViewCashPlayer:
next;
mes "[^00AAAA"+.npcname$+"^000000]";
for( .@i = 0; .@i < .num_items; .@i++ )
mes "[^00AAAA"+getitemname(.itemid[.@i])+"^000000]("+.itemid[.@i]+")";
close;
OnInit:
.num_items = query_sql("SELECT `tab`, `item_id` FROM `item_cash_db` ORDER BY `tab`", .tab,.itemid );
end;
}
this is my own custom cashshop manager.