English Help With Claw Heal

13 replies
Goto Page
To the start Previous 1 Next To the start
30.01.11 07:33:28 pm
Up
jerumdiokkk
User
Offline Off
Can anyone help me find what is wrong with that script:

Code:
1
2
3
4
5
6
7
addhook("hit","claw_heal")
function claw_heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 78) then
parse ("sethealth "..id.." "..player(id,"health")+30)
return 1
end
end
edited 1×, last 30.01.11 07:39:36 pm
30.01.11 07:38:08 pm
Up
J4x
User
Offline Off
maybe this
Code:
1
2
3
4
5
6
addhook("hit","claw_heal")
function claw_heal(id,source,weapon,hpdmg,apdmg)
if(weapon == 78) then
parse ("sethealth "..id.." "..player(id,"health")+30)
end
end
30.01.11 07:50:04 pm
Up
jerumdiokkk
User
Offline Off
hmmm stil wrong,I'm wanting to make the claw heal other players, maybe not like this script, so if you know how to do,show me plz
30.01.11 08:19:55 pm
Up
Yasday
User
Offline Off
Code:
1
2
3
4
5
6
7
addhook("hit","claw_heal")
function claw_heal(id,src,wpn,hpdmg,apdmg)
     if wpn == 78 then
          parse ("sethealth "..src.." "..player(src,"health")+30)
          return 1
     end
end
30.01.11 08:21:55 pm
Up
J4x
User
Offline Off
Can someone explain me why return 1?
30.01.11 08:24:06 pm
Up
Yasday
User
Offline Off
It's for not hurting the player.
30.01.11 08:30:41 pm
Up
J4x
User
Offline Off
thanks for the explanation
30.01.11 08:33:22 pm
Up
jerumdiokkk
User
Offline Off
yasday,is exactly like that? or this is just a sample??



Code:
1
2
3
4
5
6
7
addhook("hit","claw_heal")
function claw_heal(id,src,wpn,hpdmg,apdmg)
     if wpn == 78 then
          parse ("sethealth "..src.." "..player(src,"health")+30)
          return 1
     end
end
30.01.11 08:35:41 pm
Up
Yasday
User
Offline Off
Code:
1
2
3
4
5
6
7
addhook("hit","claw_heal")
function claw_heal(id,src,wpn,hpdmg,apdmg)
     if wpn == 78 then
          parse ("sethealth "..src.." "..player(src,"health")+30)
          return 1
     end
end

Exactly like this(maybe the ID is wrong, try it).
30.01.11 08:43:39 pm
Up
jerumdiokkk
User
Offline Off
still wrong, I already have a script, this script is to choose a class, hence has several classes, has, assault, engineer, medic, scout and tank and medic class,I wanted to put claw to heal, would by now have this script does not change anything?

because when you enter the server, was to appear a menu where you chose your class, but when I do this modification you sent me, this menu does not appear
30.01.11 09:35:38 pm
Up
Hador
User
Offline Off
that would be because the lua that Yasday wrote does not include a menu.

You would have to build it into your other script with the menu in it so that it works.
30.01.11 10:08:50 pm
Up
jerumdiokkk
User
Offline Off
but I got the script from the menu included in the same script file yasday

looks like this script

Code:
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
if sample==nil then sample={} end
bfbc={}
-----------------------
-- INITIAL SETUP --
-----------------------
function initArray(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end
bfbc.class=initArray(32)
function bfbc.classmenu(id)
     menu(id,"BF:BC2 choose class,Assault|M416-GL,Engineer|M3-Machete(Ammo),Medic|MP5-Claw(Heal),Recon|USP-(Speed),Scout|Barret .50-Mines,Tank|RPG-M249")         
end


-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","bfbc.team")
function bfbc.team(id,team)
     if (team>0) then
          bfbc.classmenu(id)
     end
end


-----------------------
-- SERVERACTION --
-----------------------
addhook("serveraction","bfbc.serveraction")
function bfbc.serveraction(id)
     bfbc.classmenu(id)
end


-----------------------
-- CLASS SELECTION --
-----------------------
addhook("menu","bfbc.menu")
function bfbc.menu(id,menu,sel)
     if (menu=="BF:BC2 choose class") then
          if (sel>=0 and sel<=7) then
               bfbc.class[id]=sel
               if (player(id,"health")>0) then
                    parse("killplayer "..id)
              parse("setdeaths "..id.." "..player(id,"deaths")-1)
              return 1
          end
          end
     end
end
-----------------------
-- SPAWN --
-----------------------
addhook("spawn","bfbc.spawn")
function bfbc.spawn(id)
     if (bfbc.class[id]==0) then
       bfbc.class[id]=math.random(1,7)
     end
     -- Assault
     if (bfbc.class[id]<=1) then
          parse ("setmaxhealth "..id.." 120")
          parse ("setarmor "..id.." 130")
          parse ("speedmod "..id.." 5")
          return "52,53,54,56,5,49,32,51";
     end
     -- Engineer
     if (bfbc.class[id]<=2) then
          parse ("setmaxhealth "..id.." 130")
          parse ("setarmor "..id.." 150")
          parse ("speedmod "..id.." 3")
          return "51,54,77,74,3,10,69";
     end
     -- Medic
     if (bfbc.class[id]==3) then
          parse ("setmaxhealth "..id.." 120")
          parse ("speedmod "..id.." 5")
          return "51,52,54,72,78,4,20,82";
     end
     -- Recon
     if (bfbc.class[id]==4) then
          parse ("setmaxhealth "..id.." 75")
          parse ("speedmod "..id.." 15")
          return "52,53,54,1,59,84";
     end
     -- Scout
     if (bfbc.class[id]==5) then
          parse ("setmaxhealth "..id.." 110")
          parse ("setarmor "..id.." 60")
          parse ("speedmod "..id.." 8")
          return "51,53,87,52,1,35,59";
     end
     -- Tank
     if (bfbc.class[id]==6) then
          parse ("setmaxhealth "..id.." 250")
          parse ("speedmod "..id.." -8")
          return "54,85,3,47,40,81";
     end
end


-----------------------
-- NO BUYING --
-----------------------
addhook("buy","bfbc.buy")
function bfbc.buy()
     return 1
end


-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","bfbc.walkover")
function bfbc.walkover(id,iid,type)
     if (type>=61 and type<=68) then
          return 0
     end
     return 1
end


-----------------------
-- NO DROPPING --
-----------------------
addhook("drop","bfbc.drop")
function bfbc.drop()
     return 1
end

-----------------------
-- NO DEAD DROPPING --
-----------------------
addhook("die","bfbc.die")
function bfbc.die()
     return 1
end 

----------------------------
--        HURT MSG        --
----------------------------
addhook("hit","bfbc.hit")
function bfbc.hit(id,src,wpn,hpdmg)
     if player(id,"health")-hpdmg < 31 then
          msg2(id,"©210000000You are hurt.Get Cover !@C")
     end
end 

--------------------------
--     MEDIC          --
--------------------------
addhook("hit","claw_heal")
function claw_heal(id,src,wpn,hpdmg,apdmg)
     if wpn == 78 then
          parse ("sethealth "..src.." "..player(src,"health")+30)
          return 1
     end
end
--------------------------
--     AMMO          --
--------------------------
addhook("attack","bfbc.ammo")
function bfbc.ammo(id)
     if (player(id,"weapontype") == 69) then
          parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley"))
          parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley"))
        
     end
end



end



was to display the menu so I could pick my class but when I do this modification that menu does not appear
08.07.11 12:54:51 am
Up
KaTiL
User
Offline Off
Code:
1
2
3
4
5
6
7
addhook('hit', 'hp')
function hp(id,src,wpn)
     if wpn == 78 then
          parse("sethealth "..id.." "..player(id,"health")+30)
          return 1
     end
end
08.07.11 01:15:35 am
Up
R a G e
User
Offline Off
@ Philung's BFBC2 mode /script.
R a G e. | doom15
To the start Previous 1 Next To the start