Forum

> > CS2D > Scripts > The clientdata usage(mouse position)!
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch The clientdata usage(mouse position)!

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt The clientdata usage(mouse position)!

tom282f3
User Off Offline

Zitieren
How to use client data to achieve this function?
1) Detects your mouse position.
2) Whenever your mouse hover on someone,
3) A hudtext shows up and says "Examine <PLAYER NAME>" which <PLAYER NAME> is the player's name who you hovered.

Please help me!!! I am going to die on dealing this myself

alt Re: The clientdata usage(mouse position)!

palomino
User Off Offline

Zitieren
user tom282f3 hat geschrieben
How to use client data to achieve this function?
1) Detects your mouse position.
2) Whenever your mouse hover on someone,
3) A hudtext shows up and says "Examine <PLAYER NAME>" which <PLAYER NAME> is the player's name who you hovered.

Please help me!!! I am going to die on dealing this myself

It is already in the default command list imo. Search.

alt Re: The clientdata usage(mouse position)!

DC
Admin Off Offline

Zitieren
take a look at sys/lua/samples/cursors.lua to see how the clientdata stuff works in general

what you need to do for your script is to loop over all living players and to compare their position with the position of the mouse pointer.
1
2
3
4
5
6
t=player(0,"tableliving")
for i=1,#t do
	if player(t[i],"x")>=cursorx and ... >= cursory and ... <= cursorx+32 and ... cursory+32 then
		... show player name...
	end
end
1× editiert, zuletzt 08.10.11 17:19:15

alt Re: The clientdata usage(mouse position)!

tom282f3
User Off Offline

Zitieren
user DC hat geschrieben
take a look at sys/lua/samples/cursors.lua to see how the clientdata stuff works in general

what you need to do for your script is to loop over all living players and to compare their position with the position of the mouse pointer.


DC thanks.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht