Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Lua Scripts/Questions/Help

6.770 Antworten
Seite
Zum Anfang Vorherige 1 2130 131 132338 339 Nächste Zum Anfang

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
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
3× editiert, zuletzt 05.01.10 19:38:28

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
TheKilledDeath hat geschrieben
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 hat geschrieben
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.

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren

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()

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Flacko hat geschrieben
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!

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Blazzingxx hat geschrieben
....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.

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

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

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
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

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Flacko hat geschrieben
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"?

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Newbie hat geschrieben
can someone help me with !players?
should show all players in the list.

If you type players in console it will show them

alt Re: Lua Scripts/Questions/Help

Redefinder
User Off Offline

Zitieren
Blazzingxx hat geschrieben
@redefinder, add at end of your script.
Code:
adminglow()

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

alt Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Zitieren
redefinder hat geschrieben
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 hat geschrieben
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.
Zum Anfang Vorherige 1 2130 131 132338 339 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht