Forum

> > CS2D > Scripts > Hudtxt2 placement.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hudtxt2 placement.

3 replies
To the start Previous 1 Next To the start

old Hudtxt2 placement.

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
function second_hook()
	for _, id in pairs(player(0,"table")) do
		if class[id] == 13 then -- Guardian
			parse("hudtxt2 "..id.." 15 Crosses : "..Player[id].cross.." 80 80 0 ")
		elseif class[id] == 8 then -- Cobra
			parse("hudtxt2 "..id.." 16 Poison : "..Player[id].venom.." 80 80 0 ")
		elseif class[id] == 6 then
			parse("hudtxt2 "..id.." 17 Sprints : "..Player[id].spd.." 80 80 0 ")
		end
Hello. Today I need some help on how to use hudtxt2. I want it to understand "poison : "..player[id].venom.." as text and then place the text at 80 80 coordinates with 0 align (that's middle I think). But when I use it, they appear in corner and e.g. says "Sprints : "..Player[id].spd.." 80 80 0" instead of just what I need. Could anyone tell me how to fix this AND it would be perfect if anyone explained the difference of " and ' and also how they change when used together with 'timer'. Thank you in advance

EDIT : Oh and don't mind the ends as it's incomplete code for second_hook

old Re: Hudtxt2 placement.

VADemon
User Off Offline

Quote
Quote
parse("hudtxt2 "..id.." 15 Crosses : "..Player[id].cross.." 80 80 0 ")


1
parse("hudtxt2 "..id.." 15 \"Crosses : "..Player[id].cross.."\" 80 80 0 ")
You need the quotation marks passed to the CS2D console so it doesn't mess up with the spaces in Crosses : "..Player[id].cross.."

old Re: Hudtxt2 placement.

Gajos
BANNED Off Offline

Quote
1
parse("hudtxt2 <[playerID]> <[hudtxtID]> <[text]> <[x]> <[y]> <[align]>")

In the code:
1
2
3
parse("hudtxt2 "..id.." 15 Crosses : "..Player[id].cross.." 80 80 0 ")
parse("hudtxt2 "..id.." 16 Poison : "..Player[id].venom.." 80 80 0 ")
parse("hudtxt2 "..id.." 17 Sprints : "..Player[id].spd.." 80 80 0 ")
you have others hudtxtID and text is wrong. Use this example code for them:
1
parse('hudtxt2 '..id..' 17 "Sprints : '..Player[id].spd..'" 80 80 0')
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview