Forum

> > CS2D > Scripts > buy exp script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch buy exp script

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt buy exp script

berserk
User Off Offline

Zitieren
help me to make script, where said rune, opening menu and select buy exp(10000$) and get random exp. Please HELP!!! Sorry for my bad English)

alt Re: buy exp script

LuaNewBie
User Off Offline

Zitieren
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
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

exps = initArray(32)

addhook("say","say")
function say(id,text)
if text == "!rune" then
	menu(id,"Rune,Buy EXP|10000$")
	return 1
	end
end

addhook("menu","menu")
function menu(id,title,button)
if title == "Rune" then
	if button == 1 then
		if (player(id,"money")>=10000) then
			parse("setmoney "..id.." "..player(id, "money") - 10000)
			exps[id]=exps[id]+math.random(1,99999)
			end
		end
	end
end

Like this ? , Untest and unoptimize

Edit 1 : Sorry , i didn't notice that checker
1× editiert, zuletzt 17.08.12 19:26:00

alt Re: buy exp script

Suprise
BANNED Off Offline

Zitieren
1
if (player(id,"money")>=10000) then

Add this after the "if button == 1 then"

alt Re: buy exp script

RedizGaming
GAME BANNED Off Offline

Zitieren
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
function Array(m)
     local array = {}
     for i = 1, m do
          array[i]=0
     end
     return array
end

exp = Array(32,0)

addhook("serveraction","a")
function a(id,action)
	if action==1 then
		menu(id,"Buy Exp,5 XP|1K,205 EXP|5K")
	end
end

addhook("menu","b")
function b(id,title,button)
if title=="Buy Exp" then
if button==1 and player(id,"money")==1000 then
parse('setmoney '..id..' '..player(id,'money')-1000)
exp[id]=exp[id]+5
elseif button==2 and player(id,"money")==5000 then
parse('setmoney '..id..' '..player(id,'money')-5000)
exp[id]=exp[id]+205
end
end
end

@user berserk:
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht