Forum
CS2D Scripts Scipt that shows x,y coordinatesScipt that shows x,y coordinates
4 Antworten 1
1
2
3
4
2
3
4
addhook("move","_move") function _move(id,x,y) parse('hudtxt2 '..id..' 1 "X: '..x..' | Y: '..y..'" 0 400') end
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("say","_say") function _say(id,txt) x,y=player(id,"x"),player(id,"y") if txt=="!mypos" then msg2(id,"My possition X: "..x.." | Y: "..y) return 1 end end
2× editiert, zuletzt 21.12.14 09:15:35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pi = {} pi.maxplayers = tonumber(game("sv_maxplayers")) for id = 1, pi.maxplayers do pi[id] = true end addhook("move","pi.move") function pi.move(id,x,y) 	if pi[id] then 		parse("hudtxt2 "..id.." 30 \"X: "..math.floor((x-16)/32 + 0.5).." Y: "..math.floor((y-16)/32 + 0.5) .."\" 5 115") 	else 				parse("hudtxt2 "..id.." 30 \"\" 5 115") 	end end addhook("say","pi.say") function pi.say(id, txt) 	if txt == "!coords" then if pi[id] then pi[id]=false else pi[id]=true end end end
1