Money System
6 replies



20.06.12 01:19:58 pm
Hey Guys Some Problem now
--------------------------
--INITIAL SETUP--
--------------------------
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
money=initArray(32,0)
addhook("kill","_kill")
function f(id)
_hud(id)
money[id] = money[id] + 500
end
function _hud(id)
parse('hudtxt2 '..id..' 6 "©255128000Money: '..money[id]..'" 10 195')
end
-- the game works but the hud never works..
--------------------------
--INITIAL SETUP--
--------------------------
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
money=initArray(32,0)
addhook("kill","_kill")
function f(id)
_hud(id)
money[id] = money[id] + 500
end
function _hud(id)
parse('hudtxt2 '..id..' 6 "©255128000Money: '..money[id]..'" 10 195')
end
-- the game works but the hud never works..
Old Names: Private Zanzetzu
add aligh parameter, it is missing
Also function f is never called
Try to rename function f to function _kill
Also function f is never called
Try to rename function f to function _kill
A thousand may fall at your side, ten thousand at your right hand, but it will not come near you. You will only look with your eyes and see the recompense of the wicked. - Psalm 91:7-8 ESV
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
money=initArray(32,0)
addhook("kill","_kill")
function _kill(id)
money[id] = money[id] + 500
_hud(id)
end
function _hud(id)
parse('hudtxt2 '..id..' 6 "©255128000Money: '..money[id]..'" 10 195')
end
addhook("join","_join")
function _join(id)
_hudremove(id)
end
function _hudremove(id)
parse('hudtxt2 '..id..' 6 "" 10 195')
end
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
money=initArray(32,0)
addhook("kill","_kill")
function _kill(id)
money[id] = money[id] + 500
_hud(id)
end
function _hud(id)
parse('hudtxt2 '..id..' 6 "©255128000Money: '..money[id]..'" 10 195')
end
addhook("join","_join")
function _join(id)
_hudremove(id)
end
function _hudremove(id)
parse('hudtxt2 '..id..' 6 "" 10 195')
end
Please encase your code in [code][/code] tags.
I've added a join hook that removes hudtxt--if it remains from a last user.
when a person leaves the server, any hudtxts on the player automatically disappear
will code for food
@
omg:
When a new player connects, the server won't atomatically send hudtxt packets as they are stored in client, not in the server.

When a new player connects, the server won't atomatically send hudtxt packets as they are stored in client, not in the server.
probably hate me, I do too



