Forum

> > CS2D > Scripts > Hux txt one on another ?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hux txt one on another ?

7 replies
To the start Previous 1 Next To the start

old Hux txt one on another ?

Rainoth
Moderator Off Offline

Quote
I was trying to make a level/exp system and it kinda works except that hud is on top of one another. After looking at the code could you tell me what I did wrong ? The x are identical but Y should set them differently

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
exptable = {100,125,150,175,700,225,250,275,300,825,350,375,400,425,950,450,475,500,525,1050,575,600,625,650,1175,700,725,750,775,800,1325,850,875,900,925,1450,950,975,1000,1025,1550,1050,1075,1100,1125,1650,1175,1200,125,1250,1775,1275,1300,1325,1350,1875,1400,1425,1450,1475,2000,1525,1550,1575,1600,2125,1650,1675,1700,1725,2250,1750,1775,1800,1825,2350,1875,1900,1925,1950,2475,2000,2025,2050,2075,2600,2100,2125,2150,2175,2700,2225,2250,2275,2300,2825,2325,2350,2375,2400,7500}
function kill_hook(id,victim,weapon,x,y)
 parse("setmoney "..id.." "..player(id,"money")+math.random(1,600))
 Player[id].exp = Player[id].exp + 15
 Player[id].credits = Player[id].credits + 15 
 _expstats(id)
end

function _expstats(id)
 local expmath = exptable[Player[id].level+1]
 if Player[id].exp >= expmath then
  Player[id].level = Player[id].level + 1
  Player[id].exp = 0
  msg(player(id,"name").. " Leveled up to "..Player[id].level)
 end
 parse('hudtxt2 '..id..' 12 "Level : "..Player[id].level.." " 320 320 0')
 parse('hudtxt2 '..id..' 13 "Exp: "..Player[id].exp.."/"..expmath.." " 320 335 0')
end

I think that's all code concerning exp hud/calculation...

old Re: Hux txt one on another ?

Rainoth
Moderator Off Offline

Quote
but isn't X - horizontal position and Y - vertical position o.O ? Ok I'll follow your advice now.
Edit : yes it works (strange for me o.O)
Anyway. Although Hud is fine the exp and level isn't shown

old Re: Hux txt one on another ?

EngiN33R
Moderator Off Offline

Quote
user VADemon has written
user Rainoth has written
X - horizontal position and Y - vertical position o.O ?

The exact opposite it is.


Hold on... Is this a joke? Please tell me it is.

X is right and left, Y is up and down.

Images >

old Re: Hux txt one on another ?

Rainoth
Moderator Off Offline

Quote
user VADemon has written
WhOops misread horizontal and vertical
However he used it wrong in his script


I thought I used it exactly like Engineer, so why did I use it wrong ??? Anyway.
Any Idea why exp and level isn't shown ?

old Re: Hux txt one on another ?

Happy Camper
User Off Offline

Quote
You are using single and double quotes incorrectly. Try this:
user Rainoth has written
1
2
parse('hudtxt2 '..id..' 12 "Level : '..Player[id].level..' " 320 320 0')
parse('hudtxt2 '..id..' 13 "Exp: '..Player[id].exp..'/'..expmath..' " 320 335 0')
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview