edited 2×, last 08.02.12 02:06:09 am
Forum
CS2D Scripts lua no works [ resolved ]'lua no works [ resolved ]'
9 replies 1
When an admin shoots a player with a m3 it will deal 100 health damage points. However if the player is not an admin or is not using the m3, it will use the cs2d hit system and deal normal damage. (Unless mp_damagefactor is changed).
You must have your usid in the table for this to work properly.
1
admins={70746}
edited 1×, last 08.02.12 01:17:15 am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
admins={70746} <--- YOUR USGN HERE i have make this for you! function admincheck(usgn) for num, val in iparis(admins) do if val==usgn then return true else return false end end end weaponid = 10 weapondamage = 100 addhook("hit","customdamage") function customdamage(id,pl,weapon) if admincheck(player(pl,"usgn"))~=false then if weapon==weaponid then if (player(id,"health")-weapondamage)>0 then parse("sethealth "..id.." "..(player(id,"health")-weapondamage)) else parse("customkill "..pl.." \""..itemtype(weapon,"name").."\" "..id) end return 1 end end end
Test now!
edited 1×, last 08.02.12 01:16:55 am
Apache uwu has written
Yeah change iparis to ipairs, should have changed it yourself, that is a pretty obvious error.
thank
you helped me a lot
1