For each Different gun like Famas scope.png
when you add the Red Dot Sight, ACOG Scope or something
1
2
2
Left Click and Scope for the gun comes on, Click it again then comes off
edited 1×, last 16.12.11 11:23:16 am
Scripts
Using a Different Scope & gun
Using a Different Scope & gun
1

Left Click and Scope for the gun comes on, Click it again then comes off
Sparty has writtenLeft Click and Scope for the gun comes on, Click it again then comes off
DevGru has written
Sparty has writtenLeft Click and Scope for the gun comes on, Click it again then comes off
not kind of that scope
Sparty has written
not thing of that scope
DevGru has written
DevGru has written
J4x has writtenlocal Scope = {}
local Sprite = {}
local Weapons = {}
table.insert(Weapons, 30, {35, 55})
table.insert(Weapons, 32, {35, 55})
function DoSetup(id, img)
	if id ~= nil then
		Scope[id] = 0
		
		if img == true then
			if Sprite[id] ~= nil then
				for i = 1, 5 do
					freeimage(Sprite[id][i])
				end
			end
			
			Sprite[id] = {
				image('gfx/scope.png', -1280, -960, 3, id),
				image('gfx/gui_shade.bmp', -1280, -960, 3, id),
				image('gfx/gui_shade.bmp', -1280, -960, 3, id),
				image('gfx/gui_shade.bmp', -1280, -960, 3, id),
				image('gfx/gui_shade.bmp', -1280, -960, 3, id)
			}
			
			for i = 2, 5 do
				imagecolor(Sprite[id][i], 0, 0, 0)
				imageblend(Sprite[id][i], 3)
			end
		elseif Sprite[id] ~= nil then
			for i = 1, 5 do
				imagepos(Sprite[id][i], -1280, -960, 0)
			end
		end
	else
		for i = 1, 32 do
			DoSetup(i, true)
		end
	end
end
DoSetup()
function OnJoin(id)
	DoSetup(id)
end
addhook('join', 'OnJoin')
function OnAlways()
	reqcld(0, 2)
end
addhook('always', 'OnAlways')
function OnClientData(id, mode, x, y)
	if (mode == 2) then
		if Scope[id] > 0 then
			imagepos(Sprite[id][1], x, y, 0)
			imagepos(Sprite[id][2], x, y - 290, 0)
			imagepos(Sprite[id][3], x + 370, y, 0)
			imagepos(Sprite[id][4], x, y + 290, 0)
			imagepos(Sprite[id][5], x - 370, y, 0)
				
			imagescale(Sprite[id][2], 128, 38, 0)
			imagescale(Sprite[id][3], 54, 96, 0)
			imagescale(Sprite[id][4], 128, 38, 0)
			imagescale(Sprite[id][5], 54, 96, 0)
		end
	end
end
addhook('clientdata', 'OnClientData')
function DoScope(id)
	if player(id, 'team') > 0 and player(id, 'health') > 0 and Weapons[player(id, 'weapontype')] ~= nil then
		local mode = Scope[id] + 1
		
		OnScope(id, mode)
		
		if mode > 2 then
			DoSetup(id)
		else
			Scope[id] = mode
		end
	end
end
function OnServerAction(id, action)
	if action == 1 then
		DoScope(id)
	end
end
addhook('serveraction', 'OnServerAction')
function OnDie(victim, killer, weapon, x, y)
	DoSetup(victim)
end
addhook('die', 'OnDie')
function OnSelect(id, type, mode)
	DoSetup(id)
end
addhook('select', 'OnSelect')
function OnHit(id, source, weapon, hpdmg, apdmg)
	if Weapons[weapon] ~= nil then
		if Scope[source] == 1 then
			msg2(source, '-- 1x Zoom ('.. Weapons[weapon][1] ..')')
		elseif Scope[source] == 2 then
			msg2(source, '-- 2x Zoom ('.. Weapons[weapon][2] ..')')
		end
	end
end
addhook('hit', 'OnHit')
function OnScope(id, mode)
	
end
Informatixa I will give you credits for my MW3 Mod
1
