2× editiert, zuletzt 08.02.12 02:06:09
Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
lua no works [ resolved ]'
9 Antworten![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)
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}
![user](img/i_friend.png)
1× editiert, zuletzt 08.02.12 01:17:15
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!
1× editiert, zuletzt 08.02.12 01:16:55
![user](img/i_friend.png)
Yeah change iparis to ipairs, should have changed it yourself, that is a pretty obvious error.
thank
you helped me a lot
![Zum Anfang](img/i_first.png)
![Vorherige](img/i_prev.png)
![Nächste](img/i_next.png)
![Zum Anfang](img/i_last.png)