So I took the AC-130 from the MW2 Killstreaks addon and when I spawn in on my public server it lets another player see the view but im controlling where they look so basically there seeing the plane view but I can fire and control the view How do I make it so It only gives all the things to me. The lua codes are below
cl_init.lua
[LUA]
include('shared.lua')
local tarpos;
local pos;
local dist;
local color;
local friendlys = {"npc_gman", "npc_alyx", "npc_barney", "npc_citizen", "npc_vortigaunt", "npc_monk", "npc_dog", "npc_eli", "npc_fisherman", "npc_kleiner", "npc_magnusson", "npc_mossman" }
local UseThermal;
local isInVehicle = false;
local PlayVoice = false;
local playerInVehicle = NULL;
local AC130IdleInsideSound = Sound("ac-130_kill_sounds/AC130_idle_inside.mp3")
local AC130Idele; //= CreateSound(LocalPlayer(), AC130IdleInsideSound )
local function drawAC130HUD()
textWhiteColor = Color(255,255,255,255)
unusedGunColor = Color(255,255,255,127)
blinkingColor = Color(255,255,255,math.sin(RealTime() * 16) * 127.5 + 127.5)
ac130weapon = LocalPlayer():GetNetworkedInt("Ac_130_weapon")
Is105mmReloading = LocalPlayer():GetNetworkedBool("Ac_130_105mmReloading")
Is40mmReloading = LocalPlayer():GetNetworkedBool("Ac_130_40mmReloading")
Is25mmReloading = LocalPlayer():GetNetworkedBool("Ac_130_25mmReloading")
local ac130weapon = LocalPlayer():GetNetworkedInt("Ac_130_weapon")
if ac130weapon == 0 then
Crosshair_105mm()
elseif ac130weapon == 1 then
Crosshair_40mm()
elseif ac130weapon == 2 then
Crosshair_25mm()
end
local sen = 0;
if ac130weapon == 0 then
sen = LocalPlayer():GetFOV() / 90;
elseif ac130weapon == 1 then
sen = LocalPlayer():GetFOV() / 105;
else
sen = LocalPlayer():GetFOV() / 120;
end
LocalPlayer():GetActiveWeapon().MouseSensitivity = sen
allEnts = ents.GetAll();
for k, v in pairs(allEnts) do
if v:IsPlayer() && v != LocalPlayer() && PlayVoice then
tarpos = v:GetPos() + Vector(0,0,v:OBBMaxs().z * .5)
pos = tarpos:ToScreen()
dist = 40;
color = teamColor(v);
if v:Team() != LocalPlayer():Team() then
surface.SetDrawColor(255,0,0,255)
surface.DrawOutlinedRect( pos.x - dist / 2, pos.y - dist / 2, dist, dist)
end
elseif v:IsNPC() then
tarpos = v:GetPos() + Vector(0,0,v:OBBMaxs().z * .5)
pos = tarpos:ToScreen()
dist = 40;
if table.HasValue(friendlys, v:GetClass()) then
else
surface.SetDrawColor(255,0,0,255)
surface.DrawOutlinedRect( pos.x - dist / 2, pos.y - dist / 2, dist, dist)
end
elseif v:IsPlayer() && v==LocalPlayer() then
lplpos = LocalPlayer():GetPos()
lpltarpos = lplpos:ToScreen()
surface.SetDrawColor(0,255,0,255)
surface.DrawLine(lpltarpos.x-25,lpltarpos.y,lpltarpos.x+25,lpltarpos.y)
surface.DrawLine(lpltarpos.x,lpltarpos.y-25,lpltarpos.x,lpltarpos.y+25)
end
end
acTime = string.ToMinutesSeconds(LocalPlayer():GetNetworkedInt("Ac_130_Time"))
if ScrH() >= 1000 then
textFont = "ChatFont"
elseif ScrH() <=1000 then
textFont = "ChatFont"
elseif ScrH() <=900 then
textFont = "ChatFont"
elseif ScrH() <=700 then
textFont = "ChatFont"
elseif ScrH() <=600 then
textFont = "ChatFont"
end
draw.SimpleText("0 A-G MAN NARO",textFont,25,25,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("RAY",textFont,25,65,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("FF 30",textFont,25,105,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("LIR",textFont,25,145,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("BORE",textFont,25,225,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("L1514",textFont,ScrW()/2,ScrH()-50,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("RDY",textFont,ScrW()/2+20,ScrH()-50,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText(acTime,textFont,ScrW()/4*3,ScrH()-50,textWhiteColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText(acHUDXPos,textFont,ScrW()-25,5,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText(acHUDYPos,textFont,ScrW()-150,5,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText(acHUDAGL.." AGL",textFont,ScrW()-25,45,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
if UseThermal then
if ThermalBlackMode then
draw.SimpleText("BHOT",textFont,ScrW()-100,85,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
else
draw.SimpleText("WHOT",textFont,ScrW()-100,85,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
end
end
if ScrH() >= 750 then
draw.SimpleText("N",textFont,ScrW()-25,ScrH()/2-250,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("T",textFont,ScrW()-25,ScrH()/2-200,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("S",textFont,ScrW()-25,ScrH()/2-100,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("F",textFont,ScrW()-25,ScrH()/2-50,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("Q",textFont,ScrW()-25,ScrH()/2+50,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("Z",textFont,ScrW()-25,ScrH()/2+100,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("T",textFont,ScrW()-25,ScrH()/2+200,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("G",textFont,ScrW()-25,ScrH()/2+250,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("T",textFont,ScrW()-25,ScrH()/2+300,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
else
draw.SimpleText("N",textFont,ScrW()-25,ScrH()/2-200,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("T",textFont,ScrW()-25,ScrH()/2-160,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("S",textFont,ScrW()-25,ScrH()/2-80,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("F",textFont,ScrW()-25,ScrH()/2-40,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("Q",textFont,ScrW()-25,ScrH()/2+40,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("Z",textFont,ScrW()-25,ScrH()/2+80,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("T",textFont,ScrW()-25,ScrH()/2+160,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("G",textFont,ScrW()-25,ScrH()/2+200,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
draw.SimpleText("T",textFont,ScrW()-25,ScrH()/2+240,textWhiteColor,TEXT_ALIGN_RIGHT,TEXT_ALIGN_TOP)
end
if ac130weapon == 0 then
draw.SimpleText("105mm",textFont,25,ScrH()-50,blinkingColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("40mm",textFont,25,ScrH()-90,unusedGunColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("25mm",textFont,25,ScrH()-130,unusedGunColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
elseif ac130weapon == 1 then
draw.SimpleText("105mm",textFont,25,ScrH()-50,unusedGunColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("40mm",textFont,25,ScrH()-90,blinkingColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("25mm",textFont,25,ScrH()-130,unusedGunColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
elseif ac130weapon == 2 then
draw.SimpleText("105mm",textFont,25,ScrH()-50,unusedGunColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("40mm",textFont,25,ScrH()-90,unusedGunColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
draw.SimpleText("25mm",textFont,25,ScrH()-130,blinkingColor,TEXT_ALIGN_LEFT,TEXT_ALIGN_TOP)
end
return true;
end
function CheckForVehicle(ply)
if ( ( !ply:InVehicle() && ply == playerInVehicle ) || !playerInVehicle:IsValid() ) && isInVehicle then
playerInVehicle = NULL;
isInVehicle = false;
end
if ply:InVehicle() && !isInVehicle then
playerInVehicle = ply;
isInVehicle = true;
surface.PlaySound("ac-130_kill_sounds/clear_to_engage.wav")
end
end
function Crosshair_105mm()
local width = 120;
local height = 60;
local lineLength = 100;
local cornerLength = 35;
local centerX = ScrW()/2;
local centerY = ScrH()/2;
distanceFromCenter = 250
if Is105mmReloading then
surface.SetDrawColor(255,255,255,math.sin(RealTime() * 8) * 127.5 + 127.5) //--surface.SetDrawColor(blinkingColor)
else
surfa
Sorry, you need to Log In to post a reply to this thread.