Untitled
unknown
plain_text
2 years ago
1.5 kB
16
Indexable
// set authorize
else if (actual_command == "/muteall") {
if (pInfo(peer)->mod >= 1) {
int Time = 5;
string By = pInfo(peer)->tankIDName;
for (ENetPeer* currentPeer = server->peers; currentPeer < &server->peers[server->peerCount]; ++currentPeer) {
if (currentPeer->state != ENET_PEER_STATE_CONNECTED or currentPeer->data == NULL) continue;
if (pInfo(currentPeer)->world == world_->name) {
add_mute(currentPeer, Time, "Mute All by:" + By, "masstapecommand");
}
}
}
}
else if (actual_command == "/freezeall") {
if (pInfo(peer)->mod >= 1) {
int Time = 5;
string By = (pInfo(peer)->d_name.empty() ? pInfo(peer)->name_color : "`0") + "" + (pInfo(peer)->d_name.empty() ? pInfo(peer)->tankIDName : pInfo(peer)->d_name) + "``";
for (ENetPeer* currentPeer = server->peers; currentPeer < &server->peers[server->peerCount]; ++currentPeer) {
if (currentPeer->state != ENET_PEER_STATE_CONNECTED or currentPeer->data == NULL) continue;
if (pInfo(currentPeer)->world == world_->name) {
PlayMods new_playmod{};
new_playmod.id = 3;
new_playmod.time = time(nullptr) + Time;
new_playmod.user = pInfo(currentPeer)->tankIDName;
pInfo(currentPeer)->playmods.push_back(new_playmod);
gamepacket_t p;
p.Insert("OnConsoleMessage");
p.Insert("Freeze! (`$Frozen`` mod added, `$5 seconds`` left)");
p.CreatePacket(currentPeer);
update_clothes(currentPeer);
}
}
}
}Editor is loading...