Forum

> > CS2D > Scripts > Weapon damage for admin
Forums overviewCS2D overview Scripts overviewLog in to reply

English Weapon damage for admin

2 replies
To the start Previous 1 Next To the start

old Weapon damage for admin

limonata
User Off Offline

Quote
Hi, i need to help about this script.

This script is working but everybody's weapon has 1000 damage. It should be only for me. May you fix it? And i need to all weapons will be 1000 damage.

Thanks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
weaps = {"USP","Glock","Deagle","P228","Elite","Five-Seven","M3","XM1014","MP5","M4A1"}

admin = {50998}

addhook("spawn","dmg")
function dmg(id)
	for _, i in ipairs(admin) do
		if player(id,"usgn") == i then
			for i = 1,#weaps do
				parse("mp_wpndmg "..weaps[i].." 1000")
			end
		end		
	end
end

old Re: Weapon damage for admin

Rainoth
Moderator Off Offline

Quote
You make all the conditions and then you change damage for certain weapons. It doesn't work that way since the damage is dealth depending on the weapon itself, not the player holding it.

You can do it a bit differently via hit hook.

1
2
3
4
5
6
addhook("hit","potatofestival)
function potatofestival(i,s,w,hpd,apd,rawd) -- I hope the sequence is fine ._.
	if player(s,"usgn")==YourPotatoUsgn then
		parse("sethealth "..i.." "..player(i,"health")-999)
	end
end
You can change it to take many USGNs from your table since I'm too lazy to do that.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview