Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2182 183 184338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Khaleed has written
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 has written
     why does this not work?
     image("gfx/backgrounds/water4.jpg", 34, 1, 101)


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

old Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Quote
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

old Predator Mod HELP

Soja1997
User Off Offline

Quote
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!

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

YellowBanana
BANNED Off Offline

Quote
Flacko has written
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

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
[/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
edited 2×, last 04.04.10 11:22:29 am

old Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Quote
@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

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
[/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?
edited 1×, last 04.04.10 11:50:16 am

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
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?

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

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

old Menu

Soja1997
User Off Offline

Quote
Can make script Smoking? hmm gen_fx Steam its Smoking can make it?
edited 1×, last 04.04.10 12:21:09 pm

old Re: Lua Scripts/Questions/Help

Patasuss
User Off Offline

Quote
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

old Re: Lua Scripts/Questions/Help

Soja1997
User Off Offline

Quote
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?
?

old Re: Lua Scripts/Questions/Help

goweiwen
User Off Offline

Quote
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

old REPAIR PLZ

Soja1997
User Off Offline

Quote
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
edited 5×, last 04.04.10 02:05:28 pm

old Re: Lua Scripts/Questions/Help

Fasttt
User Off Offline

Quote
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?

old Re: Lua Scripts/Questions/Help

Starkkz
Moderator Off Offline

Quote
Soja1997 has written
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 >
edited 2×, last 04.04.10 10:41:24 pm

old Buy Menu

Soja1997
User Off Offline

Quote
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$
edited 2×, last 05.04.10 10:52:32 am
To the start Previous 1 2182 183 184338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview