Forum

> > CS2D > Scripts > Point System
Forums overviewCS2D overview Scripts overviewLog in to reply

English Point System

3 replies
To the start Previous 1 Next To the start

old Point System

OutstandingPP
BANNED Off Offline

Quote
How can i make point system ?
buy weapons with points and buy some thing with points
just send for me the code
or
...
do what u want to do √

old Re: Point System

Bowlinghead
User Off Offline

Quote
If you want code from us, get specific.
We need to know everything. How do you get points? How much do you get? How much do the weapons cost? etc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
coins = initArray(32)

addhook("kill","myKill")
function myKill(killer, victim)
	coins[killer] = coins[killer] + 2 -- killer gets 2 coins / kill
	coins[victim] = coins[victim] -1 -- victim looses 1 / death
end

addhook("menu","myMenu")
function myMenu(id,t,b)
	if (t == "My Weapon Menu") then
		if (b==1) then -- weapon 1  -- if first button in menu is pressed
			if (coins[killer] >= 5) then  -- if enough coins
				coins[killer] = coins[killer] - 5 -- reduce coins
				parse("equip "..killer.." 5")  -- equip wpn
			end
		elseif (b==2) then -- weapon 2
			...
		end
	end
end

old Something like that?

Scott
BANNED Off Offline

Quote
¿Something like that?

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
addhook ("serveraction","menu_f2")
function menu_f2(id,action)
if action==1 then
menu(id,"Points Shop,M3|10 # Points,Armor %50|26 # Points,AWP|14 # Points,Molotov|22 # Points,M4A1|15 # Points")
end
end

addhook("menu", "show_mes2")
function show_mes2(id, title, but)
if (title=="Points Shop") then
if (but==1) then
if ms.money[id] > 10 then
				parse("equip "..id.." 10")
				msg2(id,"©255255255You've bought ©255255000M3!")
				ms.money[id]=ms.money[id]-10
				ms.moneyshow(id)
			else
				msg2(id,"©255255255You do not have enough ©255255000Points!")
 end
end
if (but==2) then
 if ms.money[id] > 25 then
				parse('equip '..id..' 80')
				msg2(id,"©255255255You've bought ©255255000Armor %50!")
				ms.money[id]=ms.money[id]-26
				ms.moneyshow(id)
			else
				msg2(id,"©255255255You do not have enough ©255255000Points!")
  end
 end
if (but==3) then
 if ms.money[id] > 13 then
				parse('equip '..id..' 35')
				msg2(id,"©255255255You've bought ©255255000AWP!")
				ms.money[id]=ms.money[id]-14
				ms.moneyshow(id)
			else
				msg2(id,"©255255255You do not have enough ©255255000# Points!")
  end
 end
 if (but==4) then
 if ms.money[id] > 21 then
				parse('equip '..id..' 3')
				msg2(id,"©255255255You've bought ©255255000Molotov!")
				ms.money[id]=ms.money[id]-22
				ms.moneyshow(id)
			else
				msg2(id,"©255255255You do not have enough ©255255000# Points!")
end
end
 if (but==5) then
 if ms.money[id] > 15 then
				parse('equip '..id..' 32')
				msg2(id,"©255255255You've bought ©255255000M4A1!")
				ms.money[id]=ms.money[id]-15
				ms.moneyshow(id)
			else
				msg2(id,"©255255255You do not have enough ©255255000# Points!")
                                                                  end
                                         end
                    end
end

ms={}

----------------------
-- Initial Setup    --
----------------------
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
ms.money=initArray(32)
function ms.moneyshow(id)
	parse('hudtxt2 '..id..' 1 "©255255000# Points: ©255255255'..ms.money[id]..' " 7 140')
end

addhook("spawn","ms.spawn")
function ms.spawn(id)
	ms.moneyshow(id)
end

addhook("kill","ms.kill")
function ms.kill(id)
	ms.money[id]=ms.money[id]+1
	ms.moneyshow(id)
end

addhook("die","ms.die")
function ms.die(id)
	ms.money[id]=ms.money[id]-0
	ms.moneyshow(id)
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview