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 2182 183 184338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Zitieren
Khaleed hat geschrieben
can some1 help me with this script =
1
2
3
4
5
6
addhook("startround","bps")
function bps
	parse("mp_wpndmg Elite 10000")
	parse("mp_wpndmg_z1 Elite 10000")
	parse("mp_wpndmg_z2 Elite 10000")
end


1
2
3
4
5
6
addhook("startround","bps") 
function bps()
	parse("mp_wpndmg Elite 10000") 
	parse("mp_wpndmg_z1 Elite 10000") 
	parse("mp_wpndmg_z2 Elite 10000") 
end

Dark Byte hat geschrieben
     why does this not work?
     image("gfx/backgrounds/water4.jpg", 34, 1, 101)


1
image("gfx/backgrounds/water4.jpg",34,1,1)

alt Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Zitieren
This function might be useful to some people, it's to draw a line from one position to another.
You need to transfer a 1x1 image to the client, and use this function:

tbl can consist of :
mode: image mode
width: line width
color: {r, g, b}
alpha: same as imagealpha
blend: same as imageblend

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function drawLine(x1, y1, x2, y2, tbl)
	if not (x1 and y1 and x2 and y2) then
		return false
	end
	tbl = tbl or {}
	local line = image('gfx/weiwen/1x1.png', 0, 0, tbl.mode or 1)
	local x3, y3, rot = (x1+x2)/2, (y1+y2)/2, math.deg(math.atan2(y1-y2, x1-x2))+90
	imagepos(line, x3, y3, rot)
	imagescale(line, tbl.width or 1, math.sqrt((x1-x2)^2+(y1-y2)^2))
	if tbl.color then
		imagecolor(line, tbl.color[1] or 0, tbl.color[2] or 0, tbl.color[3] or 0)
	end
	if tbl.alpha then
		imagealpha(line, tbl.alpha)
	end
	if tbl.blend then
		imageblend(line, tbl.blend)
	end
	return line
end

alt Predator Mod HELP

Soja1997
User Off Offline

Zitieren
Hey im from poland sorry for my bad english
i have one problem
[/code]addhook("spawn","niema")
function niema(spawnplayer)
end
     if (team>1) then
      parse("setmaxhealth "..id.." 250")          
      parse("equip "..id.." 84")          
      parse("equip "..id.." 69")
      parse("speedmod "..id.." 20")                    
end
     if (team>2) then
      parse("equip "..id.." 23")          
      parse("equip "..id.." 30")          
      parse("equip "..id.." 1")
      parse("equip "..id.." 3")
      end[/code]     

its error
Who Can Repair Plz!

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("spawn","niema")
function niema(spawnplayer)
	local team = player(spawnplayer,"team")
	if (team==1) then
		parse("setmaxhealth "..id.." 250")          
		parse("equip "..id.." 84")          
		parse("equip "..id.." 69")
		parse("speedmod "..id.." 20")                    
	elseif (team==2) then
		parse("equip "..id.." 23")          
		parse("equip "..id.." 30")          
		parse("equip "..id.." 1")
		parse("equip "..id.." 3")  
	end
end

alt Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Zitieren
Flacko hat geschrieben
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("spawn","niema")
function niema(spawnplayer)
	local team = player(spawnplayer,"team")
	local id = spawnplayer
	if (team==1) then
		parse("setmaxhealth "..id.." 250")          
		parse("equip "..id.." 84")          
		parse("equip "..id.." 69")
		parse("speedmod "..id.." 20")                    
	elseif (team==2) then
		parse("equip "..id.." 23")          
		parse("equip "..id.." 30")          
		parse("equip "..id.." 1")
		parse("equip "..id.." 3")  
	end
end

alt Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Zitieren
[/code]addhook("spawn","niema")
function niema(spawnplayer)
local team = player(spawnplayer,"team")
local id = spawnplayer
if (team==1) then
parse ("equip "..id.." 69")
parse("setweapon "..id.." 69")
parse("strip "..id.." 2")
parse("setmaxhealth "..id.." 250")
parse("equip "..id.." 84") - stealth suit
parse ("equip "..id.." 59")
parse("speedmod "..id.." 20")
elseif (team==2) then
parse("equip "..id.." 23")
parse("equip "..id.." 30")
parse("equip "..id.." 1")
parse("equip "..id.." 3")
parse("speedmod "..id.." 6")
parse("setmaxhealth "..id.." 150")
parse ("equip "..id.." 79")
end
end[/code]
Terrorist in nextround is visible WTF? HELP
2× editiert, zuletzt 04.04.10 11:22:29

alt Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Zitieren
@Soja1997
from Flacko's

This doesn't give secondary weapons, though.
1
2
3
4
5
6
7
8
9
10
11
addhook("spawn","niema")
function niema(id)
	local team = player(id,"team")
	if (team==1) then
		parse("setmaxhealth "..id.." 250")
		parse("speedmod "..id.." 20")
		return "84,69"
	elseif (team==2) then
		return "23,30,1,3"
	end
end

alt Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Zitieren
[/code]
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","walkover")
function walkover(id,iid,type)
     if (type>=1 and type<=88) then
          return 0
     end
     return 1
end
[/code]

it don't work players can take weapons and armors why?
1× editiert, zuletzt 04.04.10 11:50:16

alt Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","walkover")
function walkover(id,iid,type)
     if (type>=1 and type<=88) then
          return 0
     end
     return 1
end

it don't work players can take weapons and armors why?

alt Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Zitieren
1
2
3
4
5
6
7
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","walkover")
function walkover(id,iid,type)
	return 0
end

alt Menu

Soja1997
User Off Offline

Zitieren
Can make script Smoking? hmm gen_fx Steam its Smoking can make it?
1× editiert, zuletzt 04.04.10 12:21:09

alt Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Zitieren
In cmd type effect "smoke" x y
Replace x and y with your values..
Example:
1
2
3
4
addhook("spawn","mspawn")
function mspawn(id)
	parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y"))) --Create smoke when player spawns
end

alt Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Zitieren
Hmm
addhook("spawn","mspawn")
function mspawn(id)
parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y"))) --Create smoke when player spawns
end
can smoke if say !smoke?
?

alt Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Zitieren
Actually, return 1 to abort the collection.
1
2
3
4
5
6
7
-----------------------
-- NO COLLECTING --
-----------------------
addhook("walkover","walkover")
function walkover(id,iid,type)
     return 1
end

alt REPAIR PLZ

Soja1997
User Off Offline

Zitieren
1
2
3
4
5
addhook("say","tekst")
function tekst(id,txt) 
	if (txt=="!papieros") or (txt=="!cigarette") then
     parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
end

Who can Repair and make
1
parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
every six seconds

2.
who can make if i hit player he have flash id 100

3.
who can make if i say !drunk shake ID 3000
5× editiert, zuletzt 04.04.10 14:05:28

alt Re: Lua Scripts/Questions/Help

Fasttt
User Off Offline

Zitieren
I want bots can not damage human, but bots can damage bots.

1
2
3
4
5
6
7
8
addhook('hit','bot_hit')
function bot_hit(killer,victim)
	if player(killer,'bot') == true then --if IS bot
		if player(victim,'bot') == false then  --if NOT bot
			return 1
		end
	end
end

it does not works!
I replaced "true" and "false" and received right script (!!!):

1
2
3
4
5
6
7
function bot_hit(killer,victim)
	if player(killer,'bot') == false then -- if NOT bot
		if player(victim,'bot') == true then -- if IS bot
			return 1
		end
	end
end
surprisingly, isn't it?

alt Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Zitieren
Soja1997 hat geschrieben
1
2
3
4
5
addhook("say","tekst")
function tekst(id,txt) 
	if (txt=="!papieros") or (txt=="!cigarette") then
     parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
end

Who can Repair and make
1
parse("effect \"smoke\" "..(player(id,"x")).." "..(player(id,"y")))
every six seconds

2.
who can make if i hit player he have flash id 100

3.
who can make if i say !drunk shake ID 3000


Spoiler >
2× editiert, zuletzt 04.04.10 22:41:24

alt Buy Menu

Soja1997
User Off Offline

Zitieren
Somebody can make the Buy Menut for me because alone I am not able
Medikit|500$
Bandage|100$
Vodka|100$          parse("shake "..id.." 20000")     
PrimaryAmmo|300$
SecondaryAmmo|300$
Snowball|3000$
Armor100|1000$
Armor200|3000$
Speed x5|1000$
Speedx10|3000$
2× editiert, zuletzt 05.04.10 10:52:32
Zum Anfang Vorherige 1 2182 183 184338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht