Forum

> > CS2D > Scripts > hudtxt error (corner)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch hudtxt error (corner)

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt hudtxt error (corner)

Ridho
User Off Offline

Zitieren
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

alt Re: hudtxt error (corner)

Rainoth
Moderator Off Offline

Zitieren
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.

alt Re: hudtxt error (corner)

Ridho
User Off Offline

Zitieren
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

alt Re: hudtxt error (corner)

_oops
User Off Offline

Zitieren
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")

alt Re: hudtxt error (corner)

Ridho
User Off Offline

Zitieren
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

alt Re: hudtxt error (corner)

Yates
Reviewer Off Offline

Zitieren
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')
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht