Forum

> > CS2D > Scripts > Select Hook
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Select Hook

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Select Hook

_Vava_
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("select","onselecting")
function onselectiong(id,type,mode)
if player(id,"weapon")==51 then
parse('hudtxt2 "..id.." 1 "Mode:BlaBlaBla 290 250')
end
end
ERROR:
LUA ERROR: attempt to call a nil value

alt Re: Select Hook

eledah
User Off Offline

Zitieren
1
2
addhook("select","onselecting")
function ---> onselectiong <--- (id,type,mode)

1
parse('hudtxt2 "..id.." 1 "Mode:BlaBlaBla 290 250')
This one won't work as well.

alt Re: Select Hook

Talented Doge
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("select", "onSelecting")
function onSelecting(id, t, md)
	if t == 51 then
		parse ('hudtxt2 '..id..' 1 "Mode: BlaBlaBla" 290 250 1')
	end
end

Where id = player id
type = weapon type
mode = item mode (silence, scope etc)

cs2d lua hook select has shown the above information.

In fact your script didn't work because... You used
1
if player(id, "weapon") == 51

You should use
1
if t == 51
instead of
1
if player(id, "weapontype") == 51

There is no such thing called weapon, there is only weapontype, but you got a simpler one (t) , why would you use the more complicated one?

And t is type in your script

If you want to know what is mode, see this
1
2
3
4
5
6
addhook("select", "onSelecting")
function onSelecting(id, t, md)
	if t == 1 and md == 1 then
		parse ('hudtxt2 '..id..' 1 "Mode: BlaBlaBla" 290 250 1')
	end
end

What will this do?
This will check both whether the player selected usp and if the usp is silenced.
That's what mode is.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht