1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
bank={} function initArray(m) local array = {} for i = 1, m do array[i]=0 end return array end bank.skor=initArray(32) function bank.update(id) parse('hudtxt2 '..id..' 48 "Bank Account: '..bank.skor[id]..' " 13 430') end
add this to hooks.lua
1
2
3
4
2
3
4
addhook("spawn","bank.spawn") function bank.spawn(id) bank.update(id) end
add this to npcs.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
NPCs[2].func = function(npc, id, words, state) if words == "hi" then NPCspeak(npc, "Welcome.What you want deposit or check?'") PLAYERS[id].tmp.npcstate = {npc, 1} elseif contains(words, "bye") then NPCspeak(npc, "Goodbye sir.") PLAYERS[id].tmp.npcstate = nil elseif state == 1 then 		if contains(words, "deposit") then NPCspeak(npc, "Do you want to deposit 100$?") 		elseif state ==1 then 		if contains(words, "yes") then 		addmoney(id, -100) bank.skor[id]=bank.skor[id]+100 bank.update(id) 		message(id, "Your cash added to bank.", "255255255") 		NPCspeak(npc, "Okay your progress saved.") 		elseif contains(wors, "bye") then 				NPCspeak(npc, "Goodbye sir.") 				PLAYERS[id].tmp.npcstate = nil 			end 		end 	end end
If you are good coder you can add deposit and save bank money system good bye :d
edited 5×, last 22.07.14 02:59:56 pm