Forum

> > CS2D > Scripts > Bank System For Tibia
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Bank System For Tibia

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Bank System For Tibia

Bangrangs
User Off Offline

Zitieren
add this to functions.lua
1
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
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
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
5× editiert, zuletzt 22.07.14 14:59:56

alt Re: Bank System For Tibia

Bangrangs
User Off Offline

Zitieren
i ask yates and forum but nobody give me help. after i try to do :d (i do check system too.)

edit: i do save system.but not write here
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht