Lua Scripts/Questions/Help
6,770 replies K, got everything to work now.
Just one Problem:
Returns the wrong Wep (yes i know why o_X)
But how to fix it?
Just one Problem:
Code:
1
parse('hudtxt2 '..id..' 4 "©000255000Weapon: '..item(player(id,"weapontype"),"name")..' " 10 125')
Returns the wrong Wep (yes i know why o_X)
But how to fix it?
My post got lost in the previous page so I`m reposting it
Someone help me plz.

redefinder has written:
Why doesn`t this work?
It`s purpose is to make message of admin green and add word (Admin) to it.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
-----------------------
----ADMIN SAY-----
-----------------------
addhook("say","adminsay")
function adminsay(id)
for i,_usgn in ipairs(RANK.ADMIN) do
if player(id,"usgn") == _usgn then
msg(©000255000 "..player(player, "name").." (Admin): "..text)
return 1
end
end
end
----ADMIN SAY-----
-----------------------
addhook("say","adminsay")
function adminsay(id)
for i,_usgn in ipairs(RANK.ADMIN) do
if player(id,"usgn") == _usgn then
msg(©000255000 "..player(player, "name").." (Admin): "..text)
return 1
end
end
end
It`s purpose is to make message of admin green and add word (Admin) to it.
Someone help me plz.
SenSidethink has written:
Shoud be because u cant login to USGN atm.
So u dont have an Id
So u dont have an Id
SenSidethink has written:
I just answered lol
It cant work atm since u dont get a USGN ID
atm because the Server are down.
It cant work atm since u dont get a USGN ID
atm because the Server are down.

I tried without those lines that make script to require USGN id
Code:
1
2
3
4
5
6
2
3
4
5
6
addhook("say","adminsay")
msg(©000255000 "..player(player, "name").." (Admin): "..text)
return 1
end
end
end
msg(©000255000 "..player(player, "name").." (Admin): "..text)
return 1
end
end
end
Code:
1
2
3
4
5
6
2
3
4
5
6
addhook("say","adminsay")
function adminsay(id,txt)
if (player(id,"usgn")==xxx) then <- Put ur USGN instand of xxx
msg("©255255255"..player(id,"name").." (Admin):"..txt)
End
End
function adminsay(id,txt)
if (player(id,"usgn")==xxx) then <- Put ur USGN instand of xxx
msg("©255255255"..player(id,"name").." (Admin):"..txt)
End
End
Untested.
SenSidethink has written:
addhook("say","adminsay")
function adminsay(id,txt)
if (player(id,"usgn")==xxx) then <- Put ur USGN instand of xxx
msg("©255255255"..player(id,"name").." (Admin):"..txt)
End
End
Untested
function adminsay(id,txt)
if (player(id,"usgn")==xxx) then <- Put ur USGN instand of xxx
msg("©255255255"..player(id,"name").." (Admin):"..txt)
End
End
Untested
Thanks a lot

By the way I improved it a bit:
Code:
1
2
3
4
5
2
3
4
5
addhook("say","adminsay")
function adminsay(id,txt)
msg("©255000000"..player(id,"name").." (Admin): "..txt)
return 1
end
function adminsay(id,txt)
msg("©255000000"..player(id,"name").." (Admin): "..txt)
return 1
end
And also you don`t need this line for message to work
Code:
1
if (player(id,"usgn")==xxx) then
If u dont have the Line
Everyone will write as a "Admin"...
xDD
Code:
1
if (player(id,"usgn")==xxx) then
Everyone will write as a "Admin"...
xDD
SenSidethink has written:
If u dont have the Line
Code:
if (player(id,"usgn")==xxx) then
Everyone will write as a "Admin"...
xDD
Code:
if (player(id,"usgn")==xxx) then
Everyone will write as a "Admin"...
xDD
yes,I just made this to test it because usgn is offline:
Code:
1
2
3
4
5
2
3
4
5
addhook("say","adminsay")
function adminsay(id,txt)
msg("©255000000"..player(id,"name").." (Admin): "..txt)
return 1
end
function adminsay(id,txt)
msg("©255000000"..player(id,"name").." (Admin): "..txt)
return 1
end
When the usgn will be back online the script will look like this:
Code:
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("say","adminsay")
function adminsay(id,txt)
for i,_usgn in ipairs(RANK.ADMIN) do
if player(id,"usgn") == _usgn then
msg("©255000000"..player(id,"name").." (Admin): "..txt)
return 1
end
function adminsay(id,txt)
for i,_usgn in ipairs(RANK.ADMIN) do
if player(id,"usgn") == _usgn then
msg("©255000000"..player(id,"name").." (Admin): "..txt)
return 1
end
I still got a Problem with this:
Someone know how to fix it?
Code:
1
parse('hudtxt2 '..id..' 4 "©000255000Weapon: '..item(player(id,"weapontype"),"name")..' " 10 125')
Someone know how to fix it?
Try this
Code:
1
parse([[hudtxt2 ]]..id..[[ 4 '©000255000Weapon: ]]..item(player(id,"weapontype"),"name")..[[' 10 125]])
Still the same (and more fails LOL).
It shows just "Claw" whatever i use
Btw how can i make shapes?
(like a HUD background)
It shows just "Claw" whatever i use

Btw how can i make shapes?
(like a HUD background)
The Func like i have it atm:
Everything works, just the Wep is allways "Claw"
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-----------------------
-- COMPLETE HUD --
-----------------------
addhook("always","HUD")
function HUD()
rot = {}
for id = 1, game("sv_maxplayers"), 1 do
if player(id,"exists") then
rot[id] = player(id,"rot")
parse('hudtxt2 '..id..' 3 "©000255000Coordinates X: '..player(id,"tilex")..' Y: '..player(id,"tiley")..' " 10 100')
parse('hudtxt2 '..id..' 4 "©000255000Health: '..player(id,"health")..' Armor: '..player(id,"armor")..' " 10 113')
parse('hudtxt2 '..id..' 5 "©000255000Weapon: '..item(player(id,"weapontype"),"name")..' " 10 126')
level=sample.ut.level[id]
parse('hudtxt2 '..id..' 6 "©000255000Level: '..level..' " 10 139')
end
end
end
-- COMPLETE HUD --
-----------------------
addhook("always","HUD")
function HUD()
rot = {}
for id = 1, game("sv_maxplayers"), 1 do
if player(id,"exists") then
rot[id] = player(id,"rot")
parse('hudtxt2 '..id..' 3 "©000255000Coordinates X: '..player(id,"tilex")..' Y: '..player(id,"tiley")..' " 10 100')
parse('hudtxt2 '..id..' 4 "©000255000Health: '..player(id,"health")..' Armor: '..player(id,"armor")..' " 10 113')
parse('hudtxt2 '..id..' 5 "©000255000Weapon: '..item(player(id,"weapontype"),"name")..' " 10 126')
level=sample.ut.level[id]
parse('hudtxt2 '..id..' 6 "©000255000Level: '..level..' " 10 139')
end
end
end
Everything works, just the Wep is allways "Claw"

Oh, yeah, there was a small error
Code:
1
parse([[hudtxt2 ]]..id..[[ 4 '©000255000Weapon: ]]..itemtype(player(id,"weapontype"),"name")..[[' 10 125]])
Nice, it shows the right Wep now.
Problem:
It displays
"©000255000Weapon: Knife"
at the top left of the Screen, not at the Pos.
Edit: Fixed it.
Edit2:
Is it possible to make a Box? (Background for HUD)
With a func?
Problem:
It displays
"©000255000Weapon: Knife"
at the top left of the Screen, not at the Pos.

Edit: Fixed it.
Code:
1
parse([[hudtxt2 ]]..id..[[ 4 "©000255000Weapon: ]]..itemtype(player(id,"weapontype"),"name")..[[" 10 125]])
Edit2:
Is it possible to make a Box? (Background for HUD)
With a func?
edited 2×, last 27.01.10 01:43:12 am
I need a little help.
I created a Rank system but my kpd need in filtrations. When dialing "rank" he gives such values Kills: 20 Dies: 3 KPD: 6.77777 = [I need 6.77] ...
Sorry i bad speak english.
I created a Rank system but my kpd need in filtrations. When dialing "rank" he gives such values Kills: 20 Dies: 3 KPD: 6.77777 = [I need 6.77] ...
Sorry i bad speak english.

2 Problems i have now.
a) Is there a way to create a Shape
(Background for a HUD) without using a
Image? Like a shape Func?
b) Is there a Var that contains the alive Players?
Because i want to show how much T's and CT's
are alive
a) Is there a way to create a Shape
(Background for a HUD) without using a
Image? Like a shape Func?
b) Is there a Var that contains the alive Players?
Because i want to show how much T's and CT's
are alive

SenSidethink has written:
2 Problems i have now.
a) Is there a way to create a Shape
(Background for a HUD) without using a
Image? Like a shape Func?
b) Is there a Var that contains the alive Players?
Because i want to show how much T's and CT's
are alive
a) Is there a way to create a Shape
(Background for a HUD) without using a
Image? Like a shape Func?
b) Is there a Var that contains the alive Players?
Because i want to show how much T's and CT's
are alive

A) I dont know
B) Use a for loop and check if they are alive. Use own func tion, and add it to the checker. If alive(p) then do this else dead.