English He ball knife

2 replies
Goto Page
To the start Previous 1 Next To the start
27.03.14 06:21:36 am
Up
Pamoon
User
Offline Off
Dear guys, i have a problems, strip knife to He Grenades...
When attack with knife, then spaw a He or Snowball to enemy or ahead. Of course: infinity he.
Like this:
Code:
1
2
3
4
5
6
7
addhook("attack","attack")
function attack(id)
     if player(id,"weapon") == 50 then
          parse("strip "..id.." 75")
     end

end

Bad Eng.
27.03.14 01:48:40 pm
Up
Rainoth
Moderator
Offline Off
Your code doesn't do that in the least.

Code:
1
2
3
4
5
6
addhook("attack","boom")
function boom(id)
     if player(id,"weapontype")==50 then
          parse("spawnprojectile "..id.." 51 "..player(id,"x").." "..player(id,"y").." 350 "..player(id,"rot"))
     end
end


If you want accurate distance you'll have to use reqcld to get the position of your cursor and then calculate the distance between it and you.
27.03.14 05:24:08 pm
Up
Pamoon
User
Offline Off
oh thanks, this was done before you replied, but thanks
To the start Previous 1 Next To the start