Forum

> > CS2D > Scripts > image() function #2 and #3 special param
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch image() function #2 and #3 special param

21 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt image() function #2 and #3 special param

Yazir
User Off Offline

Zitieren
Hello again! I have got a problem with the special meaning of x/y when drawing at player:
1
image("gfx\movecs2d\customweps\g36c.PNG<m>",x>0,y<=0,id+200)
Error:
Zitat
LUA ERROR: sys/lua/movecs2d/customweps.lua:14: attempt to compare number with nil


Maybe i am using those special params wrong?

alt Re: image() function #2 and #3 special param

Joni And Friends
User Off Offline

Zitieren
You are wrong with x>0 and y<=0, x>0 its mean the position x more than 0(1,2,3,4....,n) and y<=0 is mean the position y is 0 or under 0
1
image("gfx\movecs2d\customweps\g36c.PNG",1,0,id+200) -- x = 1 and y = 0

alt Re: image() function #2 and #3 special param

Mora
User Spielt CS2D

Zitieren
Idk, i writte so fast:
1
2
3
4
5
6
7
8
9
10
weaps = {1}

(your hook blablabab)
function wepcheck(id,source,weapon,dmg)
	for _, weapid in ipairs(weaps) do
		if player(source,"weapon")==weaps then
return 1
		end
	end
end

if all is works you can just add your weapons into table, just use other ids of weapos:
1
weaps = {1,2,3,25,1321312}

alt Re: image() function #2 and #3 special param

Yazir
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
function wepcheck(id,src,wpn,dmg,apdmg,rawdmg)
	if src >=1 and src <= 32 then
		if curwep == 1 then
			local damg = 0 --(rawdmg + 100)
			parse("sethealth "..id.." "..player(id,"health") + damg)
			print("::Zadano "..tostring(damg).." obrazen graczowi o id "..tostring(id).." od gracza o id "..tostring(src).."::")
		return 1
		end
	end
end

Prints the message in the console, no errors, players still deal dmg to each other.

curwep is another variable and it's value is 1.

alt Re: image() function #2 and #3 special param

Rainoth
Moderator Off Offline

Zitieren
I don't get what you're trying to make. If it's the case that you want USP not to deal damage then.

1
2
3
4
5
6
addhook("hit","_h")
function _h(id,s,w,h,a,r)
	if w == 1 then
		return 1
	end
end

If you want it to still hit but heal for same amount, instead of return 1 use
1
parse("sethealth "..id.." "..player(id,"health")+h)

alt Re: image() function #2 and #3 special param

Joni And Friends
User Off Offline

Zitieren
Try with this code
1
2
3
4
5
6
7
8
function wepcheck(id,src,wpn,dmg,apdmg,rawdmg)
     if src>0 and id>0 then
          if wpn == 1 then
          --- other code here
          return 1
          end
     end
end

alt Re: image() function #2 and #3 special param

Yazir
User Off Offline

Zitieren
It seems like it's broken or something. I used the
1
2
3
4
5
6
7
8
function wepcheck(id,src,wpn,dmg,apdmg,rawdmg)
     if src>0 and id>0 then
          if wpn == 1 then
          --- other code here
          return 1
          end
     end
end
And it doesn't work. I can still kill people with ups, like the return doesn't do anyting.

Also, the
1
parse("sethealth "..id.." "..player(id,"health")+h)
Doesn't work. It only deals damage if it's "- h" but doesn't heal while "+ h" (yeah wtf).
1× editiert, zuletzt 07.02.15 15:25:52

alt Re: image() function #2 and #3 special param

Yazir
User Off Offline

Zitieren
Hell, even the function without ifs doesn't work

1
2
3
4
5
6
function wepcheck(id,src,wpn,dmg,apdmg,rawdmg)
	--local damg = dmg
	--parse("sethealth "..id.." "..player(id,"health") + damg)
	print("::Zadano "..tostring(dmg).." obrazen graczowi o id "..tostring(id).." od gracza o id "..tostring(src).."::")
	return 1
end

alt Re: image() function #2 and #3 special param

Mora
User Spielt CS2D

Zitieren
You don't understand bcs you don't want to.
Read up my post and don't again say shit.
You don't even know what you want exactly!
What is that other functions?
@user Rainoth: ,@user Joni And Friends: did all that you needed.
Haven't you using multi hooks? Maybe you use other scripts that conflict with yours? If you using other safezone scripts it may also conflict!
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht