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
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
-------------------------
if sample==nil then sample={} end
bfbc={}
-----------------------
-- INITIAL SETUP --
-----------------------
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
bfbc.class=initArray(32)
function bfbc.classmenu(id)
menu(id,"BF:BC2 choose class,First Class|UMP45-Elite,Second Class|Aug+Usp,Third Class|TacticalShield+Spas12")
end
-----------------------
-- TEAM -> CLASS --
-----------------------
addhook("team","bfbc.team")
function bfbc.team(id,team)
if (team>0) then
bfbc.classmenu(id)
end
end
-----------------------
-- SERVERACTION --
-----------------------
addhook("serveraction","bfbc.serveraction")
function bfbc.serveraction(id)
bfbc.classmenu(id)
end
-----------------------
-- CLASS SELECTION --
-----------------------
addhook("menu","bfbc.menu")
function bfbc.menu(id,menu,sel)
if (menu=="BF:BC2 choose class") then
if (sel>=0 and sel<=7) then
bfbc.class[id]=sel
if (player(id,"health")>0) then
parse("killplayer "..id)
parse("setdeaths "..id.." "..player(id,"deaths")-1)
return 1
end
end
end
end
-----------------------
-- SPAWN --
-----------------------
addhook("spawn","bfbc.spawn")
function bfbc.spawn(id)
if (bfbc.class[id]==0) then
bfbc.class[id]=math.random(1,7)
end
-- First Class
if (bfbc.class[id]<=1) then
parse ("setmaxhealth "..id.." 100")
parse ("setarrmor "..id.." 5")
parse ("speedmod "..id.." 1")
return "24,5"
end
-- Second Class
if (bfbc.class[id]<=2) then
parse ("setmaxhealth "..id.." 100")
parse ("setarrmor "..id.." 5")
parse ("speedmod "..id.." 1")
return "33,1"
end
-- Third Class
if (bfbc.class[id]<=3) then
parse ("setmaxhealth "..id.." 100")
parse ("setarmor "..id.." 100")
parse ("speedmod "..id.." 1")
return "41,10"
end
end
Later I will be working on ...
But now , I need HELP to make a Squad System .
Squads depends on each team-mates you have.
There are 3 classes ,First Class ( Assault ) , Support ( Tactical Support ) and Riot ( defence unit ) .
If there is a First Class you can't select First Class and you will have to select from folowing Riot , Support and more .
and if there is a First Class and a Riot and a Support just now you should be able to select again First Class.
and If someone who knows LUA well , can help me out with the script I will ask about Squads , like Squad Bravo only 5 Counter-Terrorist are allowed to join .
Squad Delta...
For Terrorist I will think later.
If you got any question ( and if you want to help me ) I will be here to answer.
No one ?
edited 2×, last 13.02.11 06:48:39 pm