Untitled
unknown
plain_text
a year ago
3.4 kB
0
Indexable
Never
//source.cpp buton else if (cch.find("action|dialog_return\ndialog_name|\nbuttonClicked|leader_") != string::npos) { string target = cch.substr(55, cch.length() - 57).c_str(); int lock = 0, itemcount = 0, itemid = 0, sayi = 0; string name = "", names = ""; int gems = 0, opc = 0, level = 0, adml = 0, bpoi = 0; int dl = 0, bgl = 0, inv = 0, ggl = 0; int xp = 0; string path_ = "players/" + target + "_.json"; //cout << path_ << endl; json j; ifstream files(path_, ifstream::binary); if (files.fail()) break; files >> j; adml = j["adminLevel"].get<int>(); name = j["name"].get<string>(); gems = j["gems"].get<int>(); opc = j["opc"].get<int>(); xp = j["xp"].get<int>(); level = j["level"].get<int>(); //bpoi = j["bpoi"].get<int>(); lock += opc / 2; lock += level / 3; lock += gems / 20000; //lock += bpoi / 500; json a_ = j["inv"].get<json>(); json f_ = j["worlds_owned"].get<json>(); for (int i_ = 0; i_ < a_.size(); i_++) { itemid = a_.at(i_)["i"].get<int>(); itemcount = a_.at(i_)["c"].get<int>(); if (itemid == 242) { lock += itemcount; } if (itemid == 1796) { lock += itemcount * 100; dl += itemcount; } if (itemid == 7188) { lock += itemcount * 10000; bgl += itemcount; } if (itemid == 8470) { lock += itemcount * 100000; ggl += itemcount; } inv++; } gamepacket_t h; h.Insert("OnDialogRequest"); h.Insert("\nadd_player_info|`0" + name + "``|" + to_string(level) + "|" + to_string(xp) + "|" + to_string(50 * ((level * level) + 2)) + "|\nadd_spacer|small|\nadd_label_with_icon|small|`oAccount net worth: `$" + to_string(lock) + " Locks``|left|242|\nadd_spacer|small|\nadd_label_with_icon|small|`oTotal Gems: `$" + to_string(gems) + "|left|112|\nadd_spacer|small|\nadd_label_with_icon|small|`oTotal Golden Gem Locks: `$" + to_string(ggl) + "|left|8470|\nadd_label_with_icon|small|`oTotal Blue Gem Locks: `$" + to_string(bgl) + "|left|7188|\nadd_label_with_icon|small|`oTotal Diamond Locks: `$" + to_string(dl) + "|left|1796|\nadd_spacer|small|\nadd_label_with_icon|small|`oTotal OPC: `$" + to_string(opc) + "|left|10668|\nadd_label_with_icon|small|`oTotal Breakpoint: `$" + to_string(bpoi) + "|left|18|\nadd_label_with_icon|small|`oInventory Size: `$" + to_string(inv) + " |left|9412|\nadd_label_with_icon|small|`oTotal Worlds Owned: `$"+ to_string(f_.size()) +"|left|1424|\nadd_spacer|small|\nadd_quick_exit|\nend_dialog|socialportal||Back|"); //h.Insert("\nadd_label|big|`w" + name + "|left||\nadd_spacer|small|\nadd_textbox|`oAccount worth: `$" + to_string(lock) + " Locks``|\nadd_spacer|small|\nadd_label_with_icon|small|`oGems: `$" + to_string(gems) + "|left|112|\nadd_spacer|small|\nadd_label_with_icon|small|`oBlue Gem Lock: `$" + to_string(bgl) + "|left|7188|\nadd_label_with_icon|small|`oDiamond Lock: `$" + to_string(dl) + "|left|1796|\nadd_spacer|small|\nadd_label_with_icon|small|`oOnline Point Currency: `$" + to_string(opc) + "|left|10668|\nadd_spacer|small|\nadd_quick_exit|\nadd_button|s|Close|"); h.CreatePacket(peer); }