Forum

> > CS2D > Scripts > "Weapon without ammo" script
Forums overviewCS2D overview Scripts overviewLog in to reply

English "Weapon without ammo" script

6 replies
To the start Previous 1 Next To the start

old "Weapon without ammo" script

muxarus
User Off Offline

Quote
Hi us unrealSoftWare! Today i got some idea and i dont know to make some script... okay, so, i want to make some script that making weapon without ammo when i get it by equip command P.S. I think that my idea is impossible to make.

old Re: "Weapon without ammo" script

Ajmin
User Off Offline

Quote
What u actually need?
While equip u need the weapon to be 0/0 ammo?

Edit:
1
2
3
4
5
6
7
8
9
addhook("say","s")
function s(id,txt)
if txt:lower():sub(1,6) =="!equip" then
wpn = txt:sub(8,10)
parse("equip "..id.." "..wpn.."")
parse("setweapon "..id.." "..wpn.."")
parse("setammo "..id.." "..wpn.." 0")
end
end

Type "!equip (wpn id)" to equip weapons!
edited 2×, last 05.02.15 12:39:05 pm

old Re: "Weapon without ammo" script

Pagyra
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("drop","weapondrop")
function weapondrop(id,iid,type,ain,a)
	if item(id,"ammo") >0 then
   item(id,"ammo")=0
	end
end

addhook("startround","weaponammonil")
function weaponammonil()
local itemlist=item(0,"table")
for _,id in pairs(itemlist) do
 	if item(id,"dropped") then
   item(id,"ammo")=0
	end
end

Not tested, errors may occur in the code

old Re: "Weapon without ammo" script

muxarus
User Off Offline

Quote
user Ajmin has written
What u actually need?
While equip u need the weapon to be 0/0 ammo?

Edit:
1
2
3
4
5
6
7
8
9
addhook("say","s")
function s(id,txt)
if txt:lower():sub(1,6) =="!equip" then
wpn = txt:sub(8,10)
parse("equip "..id.." "..wpn.."")
parse("setweapon "..id.." "..wpn.."")
parse("setammo "..id.." "..wpn.." 0")
end
end

Type "!equip (wpn id)" to equip weapons!

thank you so much! you helped me a lot
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview