Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2145 146 147338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Zitieren
ah, thanks.

but, when it kills the survivors, they don't change team

× CustomKill
× Hit

>Now i'm trying with hit again...

1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
	if player(id,weapon)==86 then
    	hpdmg = 200
	return 0
	end
end
×Doesn't work, i don't know what's the problem :S
5× editiert, zuletzt 24.01.10 05:37:57

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
RiT hat geschrieben
ah, thanks.

but, when it kills the survivors, they don't change team

×CustomKill
×Hit

>Now i'm trying with hit again...

1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     hpdmg = 200
     return 0
     end
end

×Doesn't work, i don't know what's the problem :S

I don`t know if this works but try it.
1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     parse ("maket "..victim)
     return 0
     end
end
There is also a mush easier way to kill survivors with only 1hit with gutbomb.You can set gutbomb weapon damage to 100000.
1
parse ("mp_wpndmg \"Gut Bomb\" 100000")

alt Re: Lua Scripts/Questions/Help

memo
COMMUNITY BANNED Off Offline

Zitieren
redefinder hat geschrieben
RiT hat geschrieben
ah, thanks.

but, when it kills the survivors, they don't change team

×CustomKill
×Hit

>Now i'm trying with hit again...

1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     hpdmg = 200
     return 0
     end
end




×Doesn't work, i don't know what's the problem :S

I don`t know if this works but try it.
1
2
3
4
5
6
7
addhook("hit","gut.hit")
function gut.hit(id,source,wpn,hpdmg,apdmg)
     if player(id,weapon)==86 then
     parse ("maket "..victim)
     return 0
     end
end
There is also a mush easier way to kill survivors with only 1hit with gutbomb.You can set gutbomb weapon damage to 100000.
1
parse ("mp_wpndmg \"Gut Bomb\" 100000")


omg why you do all that , just make the Gutbomb dmg high , when any zombie hit a survivor the survivor will die and be a zombie

alt Re: Lua Scripts/Questions/Help

StirlizZ-Fapicon
Super User Off Offline

Zitieren
addhook("say","spawn11")
function spawn11(id,txt)
     if(txt=="!mflare") then
freeimage(id)
id1=image("gfx/flare2.bmp",0,0,200)
imagescale(id1,1,1)
imageblend(id1,1)
imagealpha(id1,0.7)
if (player(id,"team") == 2) then
imagecolor(id1,255,255,255)

elseif (player(id,"team") == 1) then
imagecolor(id1,255,255,255)
end
     end
end




When i say !mflare script must draw flare at my position. But he follow me. Smbdy can fix it?

alt Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Zitieren
Just change image mode perimeter...

Zitat
                    Mode 0 for floor image, mode 1 for top image and
                    mode 2 for HUD image.
                    Mode 101-132: draw under this player
                    Mode 201-232: draw over this player

alt Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Zitieren
Question,
for i, v in ipairs(table) do isn't working right, I'm trying to loop through values in a table, yet it's only reading the first value.
Can somone show me an example, cause, I can't get it from the manuel.

alt Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Zitieren
Fapicon hat geschrieben
that's right:
Id1=image(gfx/flare2.bmp,0,0,2)

HUD is thing that shows your money, health, e.t.c.
But If you want to make just flare, that is not following player, and is on ground, you must:
1
id1=image("gfx/flare2.bmp",player(id,"x"),player(id,"y"),0)
And if you want to make it as light, try imageblend(id1,1)

alt Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Zitieren
Thanks blazzing, i'll try that, What does ipairs do then? Iterate thruogh the table reading the first value?
Nope, Still didn't work, Can you show me how?
is it like this?
t = {1,2,3}
function Magical(txt)
for i, Magic in pairs(t) do
if Magic == txt then
BLA BLA BLA..
Is this how it is supposed to look?
Cause I printed the value for something like this, and it printed only my usgn, not the other one.

alt ----------------->

BrunoRZ
User Off Offline

Zitieren
addhook("hit","laser")
function laser(id,source,w,hpdmg,apdmg)
     if (w == 45) then
     parse ("sethealth "..id.." "..player(id,"health") + 20)
     return 1
     end
end
> What's the problem whit this lua script?

IT IS NOT WORKING !

alt Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Zitieren
1
2
3
4
5
6
7
addhook("hit","laser")
function laser(id,source,w,hpdmg,apdmg)
     if (w == 45) then
     parse ("sethealth "..id.." "..(player(id,"health") + 20))
     return 1
     end
end

fixed some parentheses and it worked fine with me.

alt Re: Lua Scripts/Questions/Help

Homer
User Off Offline

Zitieren
ALright, I give up with this script, It's doing soemthing really weird, when I join the team t it gives me my usgn twice, and when I join ct it gives me mine and the other one, Heres the script.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ADMIN={}
ADMIN.SuperAdmins={1,2}--Just for example
addhook("team","Team")
function Team(p,team)
for i, y in ipairs(ADMIN.SuperAdmins) do
print(""..y.."")
if team == 1 then
print(""..y.."")
if player(p,"usgn") == y then--
	return 0
	else
	return 1
end
end
end
end
Alright, If I join t, or if team is equal to one it gives me two Usgn that are the same, though if I join ct, I get mine and another's, I don't really get why it's doing this, So could someone help me with this? I just want to know why it gives me different values based on that.
Previous arangments for ADMIN={} were already made and that works, it's just not working HERE
Zum Anfang Vorherige 1 2145 146 147338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht