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 2296 297 298338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
loooser has written
try
1
2
3
4
addhook("spawn","spawn")
function spawn(id)
parse('hudtxt2 '..id..' 0 "©000000000 CT: '..game("winrow_ct")..' T:  '..game("winrow_t")..'" 3 100 0') 
end


hmm, that why we learn to scripting instead use other people scripts. should be liek this.

1
parse('hudtxt2 '..id..' 1 "©000000000 CT: '..game("score_ct")..' T:  '..game("score_t")..'" 3 100 0')

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
i acctualy wanted a answer for my question but ok
try this
1
2
3
4
addhook("join","join")
function join(id)
parse("makect "..id)
end

old Re: Lua Scripts/Questions/Help

CappaCappa
BANNED Off Offline

Quote
loooser has written
@ knedliik what do you mean with a seeable score?
@kato999 yes example:
1
2
3
4
5
6
addhook("say","say")
function say(id,message)
if (message=="hi") then
parse("trigger triggername")
end
end
@steam-cs2d
try this
1
2
3
4
5
6
addhook("say, player_say")
function player_say(id, t)
if (t==!TeleAdmin) then 
parse("setpos "..id.." "..x.." "..y.."")
end
end

how do i know which id to use for removing a sertan image?(freeimage(id))


the id that is returned by image("path",x,y,mode,[pl])

old Re: Lua Scripts/Questions/Help

archmage
User Off Offline

Quote
I created this to check parameters.
More >


Examples:
1
2
3
4
5
6
-- This is how it should be used when defining a function

function foo(...)	check_param("foo", {"number", "string", "table"}, {...});
	argv = {...};
	print(argv[1], argv[2], argv[3][0]);
end

1
2
3
4
5
6
-- Calls to foo
foo(0x32, "a string", {[0]=10})	-- prints: 50 a string 10

foo(12, "string", 10)	-- ERROR! parameter types do not match

foo(0,0)	-- ERROR! incorrect parameter count

old Re: Lua Scripts/Questions/Help

Tai Lung
User Off Offline

Quote
Can someone just give me a simple script on always giving the starting money of 16000 each round? and also, where to put it plz, im new at lua.

~thanks

old Re: Lua Scripts/Questions/Help

The Camo
User Off Offline

Quote
Tai Lung has written
Can someone just give me a simple script on always giving the starting money of 16000 each round? and also, where to put it plz, im new at lua.

~thanks


Spawning player will get cash.
1
2
3
4
addhook("spawn","cashatstart")
function cashatstart(id)
parse("setmoney "..id.." 16000")
end

Place it ... in whatever .lua file you want (thats hooked with server.lua). Place in any line, everything is the same...

P.S. If you didn't want this... and meaning about round money... you can change it in your settings..

old Re: Lua Scripts/Questions/Help

Loooser
User Off Offline

Quote
@darkbyte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
image("path",x,y,mode,[pl])    Creates an image (dynamic object) on the map and returns the ID.
                		Mode 0: floor image (covered by players etc)
                		Mode 1: top image (covering players)
                		Mode 2: HUD image (covering everything, part of the interface)
                		Mode 3: super top image (covering everything on the map)
                		Mode 101-132: draw under this player (id+100)
                		Mode 201-232: draw over this player (id+200)
                		Mode 133-164: draw over this player and over entities (id+132)
                		When drawing at player, x and y are used this way:	
                		x<=0: do not rotate with player, x>0: rotate img with player
                		y<=0: only draw if not covered by fog of war, y>0: draw always
                		[pl] is an optional parameter. 0 (default value) means that
                		all players see this image. If you set it to a player ID then
               		 only this player will see this image!
                		The command returns the ID of the dynamic object image!

you can see it in the info.txt file

@Nelight try this

1
2
3
4
5
6
addhook("buy","buy")
function buy(id,weapon)
if (weapon==51) then
return 1
end
end

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Dark Byte has written
What is the mask for an image when I use image()?

I think it depends on the blending mode. By default I think uses R0 G0 B0 (not magic pink)

old @Nelight

Rainoth
Moderator Off Offline

Quote
Really simple no need for script.
just Enter parameter in your script
mp_unbuyable or something like that then list unbuyable things.
To the start Previous 1 2296 297 298338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview