I want create a script.
When I hit machet on my position spawn primary ammo
When I hit claw on my position spawn medickit
Quote
addhook("hit","cod4.health")
function cod4.health(id,source,wpn,hpdmg,apdmg)
if (wpn == 78) then
parse("sethealth "..id.." "..player(id,"health")+5)
return 1
end
addhook("hit","cod4.hit")
function cod4.hit(id)
if (wpn == 69) then
parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."")
parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."")
return 1
end
end
function cod4.health(id,source,wpn,hpdmg,apdmg)
if (wpn == 78) then
parse("sethealth "..id.." "..player(id,"health")+5)
return 1
end
addhook("hit","cod4.hit")
function cod4.hit(id)
if (wpn == 69) then
parse("spawnitem 61 "..player(id,"tilex").." "..player(id,"tiley").."")
parse("spawnitem 62 "..player(id,"tilex").." "..player(id,"tiley").."")
return 1
end
end
what is wrong ??