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 2130 131 132338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Wow, more bs.
I kinda miss the old questions, and I think that you guys are totally massacrating Lua.
1
2
3
4
5
6
7
8
9
10
11
addhook("startround","adminglow")
function adminglow()
	for index,id in ipairs(player(0,"table")) do
		if player(id,"usgn") == 29595 then
			local img=image("gfx/sprites/flare2.bmp",0,0,100+i)
			imagecolor(img,255,255,0)
			imageblend(img,1)
			imagealpha(img,0.5)
		end
	end
end
edited 3×, last 05.01.10 07:38:28 pm

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
TheKilledDeath has written
there is no hook like "image"... what do you want to hook?

srry I didn`t know,I thought that because I saw image in info file
Flacko has written
Wow, more bs.
I kinda miss the old questions, and I think that you guys are totally massacrating Lua.
Code:
addhook()
function adminglow(path,x,y,mode)
for index,id in ipairs(player(0,"table")) do
if player(id,"usgn") == 29595 then
local img=image("gfx/sprites /flare2.bmp",0,0,100+i)
imagecolor(img,255,255,0)
imageblend(img,1)
imagealpha(img,0.5)
end
end
end

why hook is empty?it shows error in console.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote

I don't know...
Maybe I didn't sleep enough.
But I've just fixed it.
You must add "startround","adminglow"
And you can remove the parameters for the function adminglow()

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flacko has written
I don't know...
Maybe I didn't sleep enough.
But I've just fixed it.
You must add "startround","adminglow"
And you can remove the parameters for the function adminglow()

For some reason it doesn`t work..........it looks as if everything is alright and there are no errors in console,BUT no glow!

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Oh, yea.
1
2
3
4
5
6
7
8
9
10
11
12
_YOUR_USGN_ = 29595
addhook("startround","adminglow")
function adminglow()
	for index,id in ipairs(player(0,"table")) do
		if player(id,"usgn") == _YOUR_USGN_ then
			local img=image("gfx/sprites/flare2.bmp",0,0,100+id)
			imagecolor(img,255,255,0)
			imageblend(img,1)
			imagealpha(img,0.5)
		end
	end
end

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Blazzingxx has written
....or you just spaming.

What Lua error it shows?
Restart CS2D.

It doesn`t show any error,it looks ok but nothing,try it yourself.

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
hmmm very strange
Here`s my lua script:
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
-----------------------
---------RANKS---------
-----------------------
addhook("spawn","rank")
function rank(id)
     parse("strip "..id.." 1")
     parse("strip "..id.." 2")
     parse('hudtxt 10 "©000255000www.cs2dcan.clan.su" 320 15 1') 
     if (player(id,"usgn") == 29590) or (player(id,"usgn") == 29590) then
          parse("equip "..id.." 1")
          parse('hudtxt 9 "©000255000RANK(SGT)" 45 111 1')
     end
     if (player(id,"usgn") == 29591) or (player(id,"usgn") == 29591) then
          parse("equip "..id.." 4")
          parse("setarmor "..id.." 25")
          parse('hudtxt 8 "©000255000RANK(Capitan)" 45 111 1') 
     end
     if (player(id,"usgn") == 29592) or (player(id,"usgn") == 29592) then
          parse("equip "..id.." 20")
          parse("setarmor "..id.." 100")
          parse('hudtxt 7 "©000255000RANK(Green)" 45 111 1')
     end
     if (player(id,"usgn") == 29593) or (player(id,"usgn") == 29593) then
          parse("equip "..id.." 10")
          parse("equip "..id.." 79")
          parse('hudtxt 6 "©000255000RANK(Advanced)" 45 111 1')
     end
     if (player(id,"usgn") == 29594) or (player(id,"usgn") == 29594) then
          parse("equip "..id.." 80")
          parse("equip "..id.." 33")
          parse("equip "..id.." 51")
          parse('hudtxt 5 "©000255000RANK(Bravo)" 45 111 1') 
     end
     if (player(id,"usgn") == 29596) or (player(id,"usgn") == 29596) then
          parse("equip "..id.." 81")
          parse("equip "..id.." 49")
          parse('hudtxt 4 "©000255000RANK(Heavy)" 45 111 1')
     end
     if (player(id,"usgn") == 29597) or (player(id,"usgn") == 29597) then
          parse("equip "..id.." 84")
          parse("equip "..id.." 52")
          parse("equip "..id.." 1")
          parse('hudtxt 3 "©000255000RANK(Spy)" 45 111 1')
     end
     if (player(id,"usgn") == 29598) or (player(id,"usgn") == 29598) then
          parse("equip "..id.." 5")
          parse("equip "..id.." 74")
          parse("equip "..id.." 77")
          parse("equip "..id.." 83")
          parse('hudtxt 2 "©000255000RANK(Elite)" 45 111 1')
     end
     if (player(id,"usgn") == 29599) or (player(id,"usgn") == 29599) then
          parse("equip "..id.." 3")
          parse("equip "..id.." 32")
          parse("equip "..id.." 51")
          parse("equip "..id.." 52")
          parse("setarmor "..id.." 100")
          parse('hudtxt 1 "©000255000RANK(Pro)" 45 111 1')
     end
end     
-----------------------
-------NO BUYING-------
-----------------------
addhook("buy","nobuy")
function nobuy(id)
return 1
end
-----------------------
--------NO DROP--------
-----------------------
addhook("drop","nodrop")
function nodrop(id)
return 1
end
-----------------------
---------ADMIN---------
-----------------------
addhook("spawn","admin")
function admin(id)
     if (player(id,"usgn") == 29595) or (player(id,"usgn") == 29595) then
          parse('hudtxt 0 "©255000000RANK(Admin)" 45 111 1')
     end
end
addhook("hit","nodmg")
function nodmg(id)
     if (player(id,"usgn") == 29595) or (player(id,"usgn") == 29595) then
     return 1
     end
end
_YOUR_USGN_ = 29595
addhook("startround","adminglow")
function adminglow()
     for index,id in ipairs(player(0,"table")) do
          if player(id,"usgn") == _YOUR_USGN_ then
               local img=image("gfx/sprites/flare2.bmp",0,0,100+id)
               imagecolor(img,255,255,0)
               imageblend(img,1)
               imagealpha(img,0.5)
          end
     end
end
How can I post an image of ingame to show you that it just doesn`t work?

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Oh, in case it wasn't obvious, you have to start a round in order to make it work.
Test it in standard mode and add some bots, that way it should "work".
Or you can just call the function, so it will start working as soon as you start the server.
Edit: Here is the proof http://i49.tinypic.com/dlhzl3.png

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Flacko has written
Oh, in case it wasn't obvious, you have to start a round in order to make it work.
Test it in standard mode and add some bots, that way it should "work".
Or you can just call the function, so it will start working as soon as you start the server.

Ah!Finally.......
So it only works in standard mode? Can`t I instead of hook "startround" make hook "spawn"?

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Newbie has written
can someone help me with !players?
should show all players in the list.

If you type players in console it will show them

old Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Quote
Blazzingxx has written
@redefinder, add at end of your script.
Code:
adminglow()

YAY! Finally it works with deathmatch,team deathmatch and other gamemodes.

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
redefinder has written
Ah!Finally.......
So it only works in standard mode? Can`t I instead of hook "startround" make hook "spawn"?

No, it works with any gamemode, but
Flacko has written
you can just call the function, so it will start working as soon as you start the server.

And that is what blazzing told you to do.
To the start Previous 1 2130 131 132338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview