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 2300 301 302338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Hikaru
User Off Offline

Quote
HaRe has written
Hikaru has written
How i can download the !broadcast command script? i can't acess amx2d webpage

When i type !broadcast and put a message everyone can see it

i'm looking for that script


1
2
3
4
5
6
addhook("say","broadcast") function broadcast(id,t)
	if string.sub(t,1,10) == "!broadcast" then
		local bt = string.sub(t,12)
		msg(player(id,"name").."(BROADCAST): "..bt)
	end
end

When i save that text?
When i press broadcast the text apprs but i want that the text appear on middle of screen and in a green color

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Hikaru has written
1
2
3
4
5
6
addhook("say","broadcast") function broadcast(id,t)
	if string.sub(t,1,10) == "!broadcast" then
		local bt = string.sub(t,12)
		msg(player(id,"name").."(BROADCAST): "..bt)
	end
end
When i save that text?
When i press broadcast the text apprs but i want that the text appear on middle of screen and in a green color


1
2
3
4
5
6
addhook("say","broadcast") function broadcast(id,t)
	if string.sub(t,1,10) == "!broadcast" then
		local bt = string.sub(t,12)
		msg("©000255000"..player(id,"name").."(BROADCAST): "..bt)
	end
end

old Re: Lua Scripts/Questions/Help

Yasday
User Off Offline

Quote
Spoiler >


For writing in the middle just add a .."@C":

1
2
3
4
5
6
addhook("say","broadcast") function broadcast(id,t)
	if string.sub(t,1,10) == "!broadcast" then
		local bt = string.sub(t,12)
		msg("©000255000"..player(id,"name").."(BROADCAST): "..bt.."@C")
	end
end

old Re: Lua Scripts/Questions/Help

EngiN33R
Moderator Off Offline

Quote
TDShuft has written
@Flacko : ty

can i use projectile with granade launcher and with rocket launchor ?


Yes, you can. projectile hook. info.txt for more info.

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
whats the problem:
1
2
3
4
5
6
7
8
9
addhook("second","second")
function second()
for i = 1, 32 do
if (player(i,"money")>0) then 					--this is line 25
money[i] = money[i] + player(i,"money")
parse("setmoney "..i.." 0")
end
end
end
the error:
LUA ERROR:... :25 attempt to compare number with boolean

old Re: Lua Scripts/Questions/Help

Vectarrio
User Off Offline

Quote
loooser has written
whats the problem:
1
2
3
4
5
6
7
8
9
addhook("second","second")
function second()
for i = 1, 32 do
if (player(i,"money")>0) then 					--this is line 25
money[i] = money[i] + player(i,"money")
parse("setmoney "..i.." 0")
end
end
end
the error:
LUA ERROR:... :25 attempt to compare number with boolean

Well, I think you must set another condition before it - player(i,"exists")
Because if player doesn't exist, then money=false (or nil, I don't remember).

old Re: Lua Scripts/Questions/Help

RyceR
User Off Offline

Quote
Its possible to stop playing sound?
like that:
1
2
3
4
5
6
7
8
9
10
11
addhook("join","lol")
function lol(id)
	parse("sv_sound2 "..id.." technotechno.ogg")
end

addhook("say","loll")
function loll(id,txt)
	if txt == "!stop" then
		-- here i want stop music.
	end
end

old Re: Lua Scripts/Questions/Help

sixpack
User Off Offline

Quote
saladface27 has written
is it possible to create entities on a map (a buyzone particularly) using lua or commands?

thanks

No! They are being created w/ player spawn points...

old Re: Lua Scripts/Questions/Help

Rainoth
Moderator Off Offline

Quote
DaKnOb has written
saladface27 has written
is it possible to create entities on a map (a buyzone particularly) using lua or commands?

thanks

No! They are being created w/ player spawn points...


Should be possible but not in certain position...
Only like if u example serveraction then on buy you get items and if another serveraction you dont... Possible

old Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Quote
Guys need script for zombie server
Bots every round MUST JOIN TO ZOMBIES
I dont know how to make that
all people sey me turn off balance and select bots join to terrorist when game start but it didnt work!
please need script!@!
(Bad english) Thanks!

old Re: Lua Scripts/Questions/Help

Infinite Rain
Reviewer Off Offline

Quote
Guys need script for zombie server
Bots every round MUST JOIN TO ZOMBIES
I dont know how to make that
all people sey me turn off balance and select bots join to terrorist when game start but it didnt work!
please need script!@!
(Bad english) Thanks!

old Re: Lua Scripts/Questions/Help

Kurumi
User Off Offline

Quote
factis699 has written
Guys need script for zombie server
Bots every round MUST JOIN TO ZOMBIES
I dont know how to make that
all people sey me turn off balance and select bots join to terrorist when game start but it didnt work!
please need script!@!
(Bad english) Thanks!


in console type mp_autoteambalance 0
To the start Previous 1 2300 301 302338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview