PLS HEELP
Forum
CS2D Scripts Lua Scripts/Questions/HelpPLS HEELP
Try this one udinrock
Doesn't work for me. Tested on dedi and localgame.
I want red for T and blue for CT.
But got blue for all.
Here is the result.
http://img18.imageshack.us/img18/4753/continysandbox00000.png
playa slaya has written
Try this why this shall never work
i have also tried without os.draw still did not work
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
os.draw = image function playa.slaya.startround(id) 	if (player(id,"team")==1) then 		pl_t = os.draw("gfx/sprites/flare4.bmp",0,0,100) 		imagecolor(pl_t,255,0,0) 		imageblend(pl_t,1) 		imagealpha(pl_t,0.4) 	else 		pl_ct = os.draw("gfx/sprites/flare4.bmp",0,0,100) 		imagecolor(pl_ct,0,0,255)z 		imageblend(pl_ct,1) 		imagealpha(pl_ct,0.4) 	end end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[spoiler]function playa.slaya.startround(id) 	if (player(id,"team")==1) then 		pl_t = image("gfx/sprites/flare4.bmp",0,0,100) 		imagecolor(pl_t,255,0,0) 		imageblend(pl_t,1) 		imagealpha(pl_t,0.4) 	elseif (player(id,"team")==2) then 		pl_ct = os.draw("gfx/sprites/flare4.bmp",0,0,100) 		imagecolor(pl_ct,0,0,255) 		imageblend(pl_ct,1) 		imagealpha(pl_ct,0.4) 	else 		-- Do nothing 	end end[/spoiler]
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
function sample.glowing.makeallglow() for i=1,32,1 do id1=image("gfx/sprites/flare2.bmp",0,0,100+i) imagescale(id1,1,1) imageblend(id1,1) imagealpha(id1,0.7) if (player(i,"team") == 1) then imagecolor(id1,255,0,0) else imagecolor(id1,0,0,255) end end end
Tell me if it still doesn't work for you :S Because both work for me.
1)It displays the !b
2)It does not print capital letters(it prints letters typed as capitals as lower case)
3)You can put the !b anywhere in the message
It is like this because all I did was adapt the "badwords" script to look for "!b" and display the message as a server message(I'm sure this is all apparent to you)
So here is the
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook ("say","saytoall") 	function saytoall(id,bm) 		 	bmw = {"!b"} 		 	bm=string.lower(bm) 		 		for i = 1,#bmw do 			if (string.find(bm,bmw[i])~=nil) then 				parse("msg ©000255000"..player(id,"name").." "..bm) 				break 			end 		end 	end
If you, the good people of the forum, could help me better my lua skills in these ways I would be forever grateful:
1) Please tell me how to take a variable from a message
EXAMPLE I want to be able to take a number or a name from a message like this "!find #player-id/name#"
2) I want to be able to take the !b out of the message
3) If anyone know of a comprehensive lesson or tutorial on Lua OTHER THAN the Reference Manual http://www.lua.org/manual/5.1/
OR the TheKilledDeath Lua Scripting
Tutorial
http://www.cs2d.com/tut/tkdlua/luatut.html
Because I've read both extensively and they just don't provide the information and details I need. I need a tutorial like this one for C++ http://www.cprogramming.com/tutorial.html , I mean there has got to be one somewhere?
And I don't have the money to buy the official book so please if you could help me that would be great; also, if you have a better lua broadcast script, could you put it up?
Thank you for your time and patience.
All that is left to you is thinking about how will you use that function to remove text from a message (if that's what you want to do)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[TIMERS] - timer(time,"func",["p"],[c])	Create a timer which will call the Lua 				function "func" after a certain time 				in milliseconds (time). 				Moreover it can pass a string parameter (p) 				to this function when calling it. 				The timer calls the function once by default. 				However you can call it several times by 				entering a count value (c). Using 0 or lower 				count values will make the timer call the 				function infinite times. - freetimer(["func"],["p"])	Remove a timer which calls a certain function 				with a certain parameter. 				Call this function without parameters or empty 				strings as parameters to remove all timers. [IMAGES] - image("path",x,y,mode)	Creates an image (dynamic object) on the map. 				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 				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 				Returns the ID of the dynamic object image. - imagecolor(id,red,green,blue)	Changes color of an image - imagealpha(id,alpha)		Changes opacity (0.0-1.0) of an image - imageblend(id,mode)		Changes blendmode of an image: 0 for normal, 				1 for light, 2 for shade and 3 for solid - imagescale(id,x,y)		Changes image scale factors - imagepos(id,x,y,rot)		Changes position and rotation of an image - freeimage(id)			Removes an image
A part from info.txt for lazy people
good luck
Doesn't work..
Something is really wrong.
-WiLSoN- has written
So to put server skins(skins that only woekr in that server) it's like on the glowing players sample ??
Yes, but they will not be perfect...
they won't be as good as the default ones ?
EDIT(because of the multi post warning):
i'm getting an error that says :
1
LUA ERROR: dir:bad argument #1 to 'player' (number expected,got nil)
1
if (player(id,"exists")) then
1
for i = 1, 32 do
edited 1×, last 12.11.09 11:37:20 pm
-WiLSoN- has written
what do you mean with that it won't be perfect ?
they won't be as good as the default ones ?
they won't be as good as the default ones ?
he said that because, for example if u reload it doesnt do nothing.
But i think u can make it better with lua script, for eg using reload hook...
test it out for me will you guys?
Main Idea of this script is to tele another person to ur pos
Also i'm planning to make a attack2 opens building menu script(just like wrench)
Do you know How to do, that CT and TT have got other classes? I know only how to do, that CT and TT have got the same (Pyro etc)
And How to do, that all classes have got other weapons on the start?
Please help
~Carbon
Edit: Fixed with on spawn instead.
1
2
3
4
2
3
4
addhook("startround","lol") function lol 	----Here i need to add the script---- end
So i want to script something like "When i go to a new tile that i getting a new weapon or something..." Need Help...
Please, more clear.
When you pick weapon: something happends? What should happend?