Forum

> > CS2D > Scripts > hudtxt error (corner)
Forums overviewCS2D overview Scripts overviewLog in to reply

English hudtxt error (corner)

7 replies
To the start Previous 1 Next To the start

old hudtxt error (corner)

Ridho
User Off Offline

Quote
I want to know how to fix my script, initially my hudtxt code works well, everything just placed in it's position
my code
1
2
3
parse("hudtxt2 "..id.." 0 "..colo[4].."Unknown Script 320 20 1")
parse("hudtxt2 "..id.." 1 "..colo[2].."Level : ( "..level[id].." / "..lvlmax.." ) 20 415 0")
parse("hudtxt2 "..id.." 2 "..colo[2].."Exp : ( "..exp[id].." / "..persenku.." ) 20 430 0")
then I edited my script by adding this code in minute hook
1
msg(os.date(""..colo[4].."Time: %I:%M %p"))

when I tested it, all of my hud changed it's position to the left-top corner
IMG:https://i57.tinypic.com/if6bmq.jpg


when I "undo" my code then tested it again there's just nothing happened, my hud still in the corner, but no error showed in console
help me, thanks

old Re: hudtxt error (corner)

Rainoth
Moderator Off Offline

Quote
1
2
3
parse("hudtxt2 "..id.." 0 "..colo[4].."Unknown Script" 320 20 1")
parse("hudtxt2 "..id.." 1 "..colo[2].."Level : ( "..level[id].." / "..lvlmax.." )" 20 415 0")
parse("hudtxt2 "..id.." 2 "..colo[2].."Exp : ( "..exp[id].." / "..persenku.." )" 20 430 0")

Though I'd quote it differently. See if what I posted above works, if not, I'll rewrite it how I'd do it.
Just so you understand what is wrong. You didn't write enough quotes so CS2D understood it like so:
"parse a hudtxt2 to id with hud id 0 and text "<variable colo[4] as well as Unknown Script 320 20 1" with no x position with no y position and no align, therefore at position 0 0"
This applies to all your HUDs.

old Re: hudtxt error (corner)

Ridho
User Off Offline

Quote
I compared my code with user Rainoth's code, there's a difference
I'm using Notepad++
IMG:https://i58.tinypic.com/2bbbs2.png


I think the "orange" colors in x position, y position and align will lead to bug

old Re: hudtxt error (corner)

_oops
User Off Offline

Quote
1
2
3
parse("hudtxt2 "..id.." 0 \""..colo[4].."Unknown Script\" 320 20 1")
parse("hudtxt2 "..id.." 1 \""..colo[2].."Level : ( "..level[id].." / "..lvlmax.." )\" 20 415 0")
parse("hudtxt2 "..id.." 2 \""..colo[2].."Exp : ( "..exp[id].." / "..persenku.." )\" 20 430 0")

old Re: hudtxt error (corner)

Ridho
User Off Offline

Quote
I read user Rainoth's description carefully, then I rewrite it with
" and ', finally it's fixed

I don't know how quotes works or the difference between " and '

user _oops thanks

old Re: hudtxt error (corner)

Yates
Reviewer Off Offline

Quote
Escaping quotations is bad.
1
2
3
parse('hudtxt2 '..id..' 0 "'..colo[4]..'Unknown Script" 320 20 1')
parse('hudtxt2 '..id..' 1 "'..colo[2]..'Level: ( '..level[id]..' / '..lvlmax..' )" 20 415 0')
parse('hudtxt2 '..id..' 2 "'..colo[2]..'Exp : ( '..exp[id]..' / '..persenku..' )" 20 430 0')
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview