local meta = FindMetaTable("Player") function meta:Send(msg) umsg.Start( "911_Notify", self ) umsg.String( msg ) umsg.End() end function SendAll(msg) umsg.Start( "911_Notify" ) umsg.String( msg ) umsg.End() end local Polices = {TEAM_POLICE, TEAM_CHIEF, TEAM_MAYOR, TEAM_FBI, TEAM_UCOP, TEAM_SWAT, TEAM_SWATL} hook.Add("PlayerSay", "NineOneOne", function(ply, cmd, bool) if string.StartWith(cmd, "/911") then if string.len(cmd) > 6 then local total = string.sub(cmd, 5) if total == " " or total == " " or total == "" then ply:Send("Wrong, /911 ") end if not table.HasValue(Polices, ply:Team()) then total = ply:Nick().." Is requesting police: "..total.."!" else total = ply:Nick()..": "..total end if not ply.nineoneone then ply.nineoneone = CurTime() else if ply.nineoneone + 90 > CurTime() and not table.HasValue(Polices, ply:Team()) then ply:Send("You must wait "..ply.nineoneone + 90 - CurTime().." sec more to do next request!") return "" end end local count = 0 local polices = 0 for k, v in pairs(player.GetAll()) do count = count + 1 if table.HasValue(Polices, ply:Team()) then polices = polices + 1 end end if count == 0 or count == 1 or polices == 0 then ply:Send("There's no police in the server.") return "" elseif polices > 0 then if table.HasValue(Polices, ply:Team()) and polices == 1 then ply:Send("You can't talk to your self!") return "" end end if not table.HasValue(Polices, ply:Team()) then ply:Send(total) end for k, v in pairs(player.GetAll()) do if table.HasValue(Polices, ply:Team()) then v:Send(total) end end ply.nineoneone = CurTime() return "" else ply:Send("Wrong, /911 ") return "" end end end)