Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.5 kB
8
Indexable
Never
// 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);
				}
			}
		}
	}