Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 2158 159 160338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
GINO has written
i reaserch so much for just this thing
if it doesent work lets think all that its imposible

Lol, you sound like a little fag

1
parse('hudtxt2 '..id..' 2 "©250070000 Vida: '..player(id,"health")..'" 420 420 1')

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
Flacko has written
GINO has written
i reaserch so much for just this thing
if it doesent work lets think all that its imposible

Lol, you sound like a little fag

1
parse('hudtxt2 '..id..' 2 "©250070000 Vida: '..player(id,"health")..'" 420 420 1')


Flacko's code is right (;
Use that!

old Re: Lua Scripts/Questions/Help

leoska
User Off Offline

Quote
I have not worked recover, help me...
if (bio_class[id]==5) then
if (player(id,"exists")) then
parse("sethealth "..id.." "..player(id,"health")+3))
end
end

old Re: Lua Scripts/Questions/Help

0ito
User Off Offline

Quote
need help for put the terrorists and counter-terrorist in the survivors in the zombie mod if someone help me on what to put in the script I thank

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
Leo7755 has written
I have not worked recover, help me...
if (bio_class[id]==5) then
if (player(id,"exists")) then
parse("sethealth "..id.." "..player(id,"health")+3))
end
end


First of all here is your code tabbed:
Spoiler >


And i think you'll have to + the 3 hp another way maybe...
I think Blazzingxx can help if he passes (:

---------------------------------------------------------------------------------

I have a problem!
1
parse([[hudtxt2 ]]..id..[[ 7 "©000255000Pixels: ]]..player(id,"x")..[[ x ]]..player(id,"y")..[[" 5 196]])

This line just make a hudtxt with the players position in pixels... but i get a lot of digits after a comma... how can i fix it? ...I don't want that comma.
I think i'll have to use some "math.blabla"... but i don't know that tag (:
Help!

Here is a screenshot:
IMG:https://f50.img-up.net/aim_AKD_Scsxzy.jpg
edited 3×, last 08.02.10 09:38:06 pm

old Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Quote
Flacko has written
GINO has written
i reaserch so much for just this thing
if it doesent work lets think all that its imposible

Lol, you sound like a little fag

1
parse('hudtxt2 '..id..' 2 "©250070000 Vida: '..player(id,"health")..'" 420 420 1')


It doesn't work, it gives me this error:
bad argument #1 to 'player' (number expected, got function)

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
Have you remeber'd to add a "always" hook?

If not -> Use this code:
1
2
3
4
addhook("always","GIVE IT A NAME HERE")
function THE NAME YOU ENTERED HERE(id)
parse('hudtxt2 '..id..' 2 "©250070000 Vida: '..player(id,"health")..'" 420 420 1')
end

old Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Quote
Anders4000 has written
Have you remeber'd to add a "always" hook?

If not -> Use this code:
1
2
3
4
addhook("always","GIVE IT A NAME HERE")
function THE NAME YOU ENTERED HERE(id)
parse('hudtxt2 '..id..' 2 "©250070000 Vida: '..player(id,"health")..'" 420 420 1')
end



I tried with ms100 and it didn't work, i'll try with always now..

Doesn't work... it gives me another error:
bad argument #1 to 'player' (number expected, got nil)

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
@Anders4000,
Use math.ceil()

By the way, replace [[ ]] with " becouse it's better if you are beginner.
1
parse('hudtxt2 '..id..' 0 "©000255000Pixels: '..player(id,"x")..' x '..player(id,"y")..'" 5 196')
edited 2×, last 08.02.10 10:09:33 pm

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
@Rit:
That's not my fault.

@Leo:
You have to use setmaxhealth and you have to use parethesis in the right way.

@Anders
1
2
3
4
5
6
7
8
function math.round(n)
     a = math.floor(n) + 0.5
     if a > n then
          return math.floor(n)     
     elseif a <= n then
          return math.ceil(n)
     end
end

old Re: Lua Scripts/Questions/Help

Anders4000
User Off Offline

Quote
RiT has written
Anders4000 has written
Have you remeber'd to add a "always" hook?

If not -> Use this code:
1
2
3
4
addhook("always","GIVE IT A NAME HERE")
function THE NAME YOU ENTERED HERE(id)
parse('hudtxt2 '..id..' 2 "©250070000 Vida: '..player(id,"health")..'" 420 420 1')
end



I tried with ms100 and it didn't work, i'll try with always now..

Doesn't work... it gives me another error:
bad argument #1 to 'player' (number expected, got nil)


Try with this code then:
1
2
3
4
addhook("always","GIVE IT A NAME HERE")
function THE NAME YOU ENTERED HERE(id)
parse([[hudtxt2 ]]..id..[[ 10 "©000255000Vida: ]]..player(id,"health")..[[" 5 144]])
end

old Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Quote
Anders4000 has written
Try with this code then:
1
2
3
4
addhook("always","GIVE IT A NAME HERE")
function THE NAME YOU ENTERED HERE(id)
parse([[hudtxt2 ]]..id..[[ 10 "©000255000Vida: ]]..player(id,"health")..[[" 5 144]])
end


same error .__.

Flacko has written
@Rit:
That's not my fault.


Eh?.. gracias? ;S

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
RiT has written
Flacko has written
@Rit:
That's not my fault.


Eh?.. gracias? ;S


It's enough with having that shit fixed the first time.
Why don't you better go and play minesweeper instead of playing "being a programmer"?

old Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Quote
Flacko has written
RiT has written
Flacko has written
@Rit:
That's not my fault.


Eh?.. gracias? ;S


It's enough with having that shit fixed the first time.
Why don't you better go and play minesweeper instead of playing "being a programmer"?


We perdoname vos nacistes sabiendo.. Y gracias por insultarme en ingles jaja..

Y no, no esta "fixed" porque no me anda asique no te pongas así

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
RiT has written
We perdoname vos nacistes sabiendo.. Y gracias por insultarme en ingles jaja..

Y no, no esta "fixed" porque no me anda asique no te pongas así


That's my point, I fixed your error in the first place and I tested it to make sure that it works, and it did.
If you just don't know how to make a 3 lined function, don't blame me because as I said, it's not my fault.

old Re: Lua Scripts/Questions/Help

Zeik
User Off Offline

Quote
Flacko has written
You're welcome


at least you gave me a base to make it work fine, i think...

anyway, it works so, thanks lol.
edited 1×, last 09.02.10 12:24:06 am
To the start Previous 1 2158 159 160338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview