Untitled
unknown
plain_text
3 years ago
760 B
11
Indexable
else if (actual_command.substr(0, 8) == "/search " && pInfo(peer)->adminLevel >= 3) {
string item = to_lower(cmd.substr(8, cmd.length() - 8).c_str());
string results = "";
gamepacket_t p;
if (item.length() < 3) {
p.Insert("OnConsoleMessage");
p.Insert("`4Error! `oYou can search minumum 3 letter item.");
p.CreatePacket(peer);
return;
}
for (int i = 0; i < items.size(); i++) {
if (items[i].name).find(item) != string::nposs) {
results += "\nadd_label_with_icon|small|"+ items[i].name +"|left|"+ to_string(i) +"|";
}
}
p.Insert("OnDialogRequest");
p.Insert("\nadd_label_with_icon|big|`2Search Results|left|1252|\nadd_spacer|small|"+ results +"\nadd_spacer|small|\nadd_button|clsls|Close");
p.CreatePacket(peer);
}Editor is loading...