but i need script friendly fire dmg 0
Forum
CS2D Scripts Lua Scripts/Questions/Helpbut i need script friendly fire dmg 0
Code:
!givelicense ID
!removelicense ID
--------------------------------------------
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
license = initArray(32)
posy = initArray(32)
posx = initArray(32)
collect = initArray(32)
addhook("leave","license_leave")
function license_leave(id)
license[id]=0
collect[id]=0
posy[id]=0
posx[id]=0
end
addhook("serveraction","license_action")
function license_action(id,b)
if license[id]==1 and b==1 then
menu(id,"License Menu,Set Pos,Teleport,Collect")
elseif license[id]==0 and b==1 then
msg2(id,"You dont have license")
end
end
addhook("menu","license_menu")
function license_menu(id,title,button)
if title=="License Menu" then
if button==1 then
posx[id]=player(id,"x")
posy[id]=player(id,"y")
msg2(id,"Youve saved ur positon")
elseif button==2 and posy[id]==1 and posx[id]==1 then
parse ("setpos "..p.." "..posx[id].." "..posy[id])
msg2(id,"Youve teleported your self")
elseif button==2 and posy[id]==0 posx[id]==0 and
msg2(id,"You cant teleport your self, No position setted")
elseif button==3 collect[id]==0 then
msg2(id,"Collection ON")
collect[id]=1
elseif button==3 collect[id]==1 then
msg2(id,"Collection OFF")
collect[id]=0
end
end
end
addhook("collect","license_collect")
function license_collect(id)
if collect[id]==1 then
return 1
elseif collect[id]==0 then
return 0
end
end
Ruirize has written
Stop copying the CC.
Really.
Use your imaginations, don't just steal ideas.
Really.
Use your imaginations, don't just steal ideas.
Woot? I stealed nothing; fail.
edit: If u ment me xP
Balance has written
Im trying to make a script for my server that heals you when you hit with a gutbomb, and yeah that doesnt have a return 1 yet but I dont think thats the problem.
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("hit","ham_hit") function ham_hit(weapon, id, source) 	if(weapon>86) then 		parse("sethealth "..source.." "..player(source,"health")+math.random(10,20)) 		msg2(source,"You have eaten a hamburger!") 	end end
Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
1
2
2
function ham_hit(id,source,weapon) if weapon == 86
FN_Nemesis has written
hello everyone i need a script that make only weapons to use flare 3!
I can not understand you. Explain (In a way that can be understood).
edited 1×, last 03.09.10 03:01:49 am
I want to use HaRes & vesa-omars dropknife lua (already asked for permission which is pending) for NTDs half life mod but i need to 1st modify it so that when u drop the knife a knife_d model actually appears like with other weapons.
the D model knife must also be capable of being picked up like with other weapons.
heres the DL link to the lua
http://www.unrealsoftware.de/files_show.php?file=1922
Heres the actual code. Could someone plz tell me what i would have to do in order to make this lua drop a usable knife_d model?
Code:
parse("mp_wpndmg claw 0")
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
knife = initArray(32)
addhook("walkover","dropknife_walkover")
function dropknife_walkover(id,iid,type,ain,a,mode)
if type==50 then
parse("strip "..id.." 78")
knife[id]=1
end
end
addhook("drop","dropknife_drop_claw")
function dropknife_drop_claw(id,iid,type,ain,a,mode,x,y)
if type==78 then
return 1
end
end
addhook("die","dropknife_die_claw")
function dropknife_die_claw(victim,killer,weapon,x,y)
if weapon==78 then
return 1
end
end
addhook("die","dropknife_die")
function dropknife_die()
knife[id]=0
end
kniferemove=0
addhook("drop","dropknife_dropcheck")
function dropknife_dropcheck(id,iid,type,ain,a,mode,x,y)
if knife[id]==1 then
return 0
elseif knife[id]==0 then
parse("setweapon "..id.." 78")
kniferemove=0
end
end
addhook("ms100","dropknife_second")
function dropknife_second()
for i = 1,32 do
kniferemove=kniferemove+1
if kniferemove==1 then
god damit how do i get this retarded code thing working >>
edited 3×, last 03.09.10 04:14:31 am
Flacko has written
Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
Balance has written
Im trying to make a script for my server that heals you when you hit with a gutbomb, and yeah that doesnt have a return 1 yet but I dont think thats the problem.
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("hit","ham_hit") function ham_hit(weapon, id, source) 	if(weapon>86) then 		parse("sethealth "..source.." "..player(source,"health")+math.random(10,20)) 		msg2(source,"You have eaten a hamburger!") 	end end
Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
1
2
2
function ham_hit(id,source,weapon) if weapon == 86
heyy thanks imma try it now.
EDIT: Didnt work all it does is just throw the gutbomb..?
EDIT2: Now I just understood that you actually gotta hit yourself :/, does any know a hook like on shoot?
edited 1×, last 03.09.10 03:55:24 pm
Balance has written
heyy thanks imma try it now.
EDIT: Didnt work all it does is just throw the gutbomb..?
EDIT2: Now I just understood that you actually gotta hit yourself :/, does any know a hook like on shoot?
Flacko has written
Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
Balance has written
Im trying to make a script for my server that heals you when you hit with a gutbomb, and yeah that doesnt have a return 1 yet but I dont think thats the problem.
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("hit","ham_hit") function ham_hit(weapon, id, source) 	if(weapon>86) then 		parse("sethealth "..source.." "..player(source,"health")+math.random(10,20)) 		msg2(source,"You have eaten a hamburger!") 	end end
Good, but you're using the bigger than operator (>), when you should use the equal operator (==), also, your parameters' order is messed up. Just replace these lines:
1
2
2
function ham_hit(id,source,weapon) if weapon == 86
heyy thanks imma try it now.
EDIT: Didnt work all it does is just throw the gutbomb..?
EDIT2: Now I just understood that you actually gotta hit yourself :/, does any know a hook like on shoot?
1
2
3
2
3
addhook("attack","whatever") function whatever(id) 	if (player(id,"weapontype") == ID) then
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("attack","ham_eat") function ham_eat(id) if (player(id,"weapontype") == 86) then 		parse("sethealth "..id.." "..player(id,"health")+math.random(10,20)) 		msg2(id,"You have eaten a hamburger!") 	end end
LUA ERROR: attempt to call a nil valve
in this u will eat hamburger on collectin and u cant drop hamburger and eat this again u must throw it
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("collect","hamburger") function hamburger(id,iid,type,ain,a,mode) 	if type==86 then 		parse("sethealth "..id.." "..player(id,"health")+math.random(10,20)) 		msg2(id,"You have eaten a hamburger!") 	end end addhook("drop","dropham") function dropham(id,iid,type,ain,a,mode,x,y) 	if type==86 then 	return 1 	end return 0 end
i hope it helped u
Phenixtri has written
wow >> so much for asking for help >> makes this thread kinda useless if no one actually responds to your question >>
Whenever you post a lua script, wrap it in the CODE tags, for readability's sake. Also, the script you posted isn't even complete, it's missing a few "end"s at the end.
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
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
addhook("hit","ham_hit") function ham_hit(id,source,weapon) if weapon == 86 then parse("sethealth "..source.." "..player(source,"health")+math.random(10,20)) msg2(source,"You have eaten a hamburger!") 	return 1 end end addhook("drop","ham_drop") function dropham(id,iid,type,ain,a,mode,x,y) if type==86 then return 1 end return 0 end addhook("say","ham_say") function ham_say(p,txt,weapon) 	if (txt=="!give_ham") then 		else if weapon == 86 then 			parse("strip "..p.." 4") 		end 		return 1 	end end
edited 1×, last 03.09.10 08:52:17 pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("attack","hamthrow") function hamthrow(id) if (player(id,"weapontype") == 86) then parse("sethealth "..id.." "..player(id,"health")+math.random(10,20)) msg2(source,"You have eaten a hamburger!") return 1 end end addhook("drop","hamdrop") function hamdrop(id,iid,type,ain,a,mode,x,y) if type==86 then return 1 end return 0 end addhook("say","getham") function getham(p,txt,weapon) 	if (txt=="!give_ham") then 		parse("equip "..p.." 86") 		return 1 	end end