Forum

> > CS2D > Scripts > every round equip weapons
Forums overviewCS2D overview Scripts overviewLog in to reply

English every round equip weapons

5 replies
To the start Previous 1 Next To the start

old every round equip weapons

lennon
User Off Offline

Quote
Well i have difficult thing to do. Script should be like that: every 10 rounds giving items for players when startround. So first,second,till to 9 round its normal, 10 round for example all get m4a1 and deagle, next 11,12 till 20, players get diffrent for example flamethrower. Like event every 10 rounds. I know i can use random rounds but its not in my thing.

old Re: every round equip weapons

Talented Doge
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
rounds = 0
randomnumber = nil
random_rounds ={
[1] = {"Knife", "x"};
[2] = {"AWP", "35"};
}

addhook("startround_prespawn", "_st_pre")
addhook("spawn", "_spawn")

function _st_pre()
	rounds = rounds + 1
	if rounds == 2 then randomize() rounds = 0 end
end

function randomize()
	randomnumber = math.random(1, #random_rounds)
	msg (random_rounds[randomnumber][1].." round!")
end

function _spawn(p)
	if randomnumber ~= nil then return random_rounds[randomnumber][2] end
end

old Re: every round equip weapons

Louie
User Off Offline

Quote
Maybe this? I didn't tested it though.
1
2
3
4
5
6
7
8
9
10
11
12
rounds = 0

addhook("startround","_start")
function _start(mode)
	if rounds < 10 then
		rounds = rounds + 1
	elseif rounds == 10 then
		--equip players--
	else
		rounds = 0
	end
end

old Re: every round equip weapons

Kirito2K
User Off Offline

Quote
Here is it , tested!
CODE >

old Re: every round equip weapons

lennon
User Off Offline

Quote
Well all u have good scripts I need to do strip all items from random rounds after round, its imposible ?
user Talented Doge good script
user Kirito2K Good as well
user Louie good
Guys I need a custom rounds. I want to choose which weapons and this hard thing to strip after finish rounds strip weapons from random round. I hope so u understand me

old Re: every round equip weapons

Talented Doge
User Off Offline

Quote
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
randomnumber = nil
endofround = false
grenades = {51, 52, 53, 54, 72, 73, 75, 76, 86, 89}

WTFround_speedmod = true
WTFround_speedmod_value = 25
Rushround_speedmod_value = 15
weapons_hns = {10, 11}
 
--------------------------------------------------
 
addhook("spawn", "_spawn")
addhook("startround_prespawn", "_start_pre")
addhook("endround", "_end")
addhook("buy", "_buy")
addhook("second", "_sec")
addhook("walkover", "_walk")
if allow_reload_server then addhook("serveraction", "_sva") end
 
--------------------------------------------------
 
random_rounds ={
[1] = {"Knife", "x"};
[2] = {"AWP", "35, 51"};
[3] = {"M3", "10, 53"};
[4] = {"WTF", "45, 83", 1};
[5] = {"Melee", "69, 78, 85"};
[6] = {"Pistol", "1, 2, 3, 4, 5, 6"};
[7] = {"One Shot Deagle", "3" , 2};
[8] = {"Build the Base", "74", 3};
[9] = {"Flame everywhere", "73"};
[10] = {"Grenades", "51, 52, 53, 54, 72, 73, 75, 76, 86, 89"};
[11] = {"Rush", "21, 23", 4};
[12] = {"Hide and seek", "84", 5};
[13] = {"Standard", "32, 3, 51, 58", 6}
}
 
--------------------------------------------------
 
server_presettings =
{
{"sv_gamemode", "0"};
{"mp_deathdrop", "4"};
{"mp_postspawn", "5"};
{"mp_hud", "73"};
{"mp_dispenser_money", "1000"};
{"mp_building_limit", "turret", "100"};
{"sv_fow", "0"};
{"mp_wpndmg", "Deagle", "34"}
}
 
--------------------------------------------------
 
for _, func in pairs (server_presettings) do
    if func[3] then
        parse (func[1].." "..func[2].." "..func[3])
    else
        parse (func[1].." "..func[2])
    end
end
 
function _end()
    endofround = true
    if randomnumber ~= nil then
    if random_rounds[randomnumber][1] == 'One Shot Deagle' then
        deagle_damage()
    elseif random_rounds[randomnumber][1] == 'Guard the Base' then
        parse("mp_hud 73")
    elseif random_rounds[randomnumber][1] == 'Standard' or random_rounds[randomnumber][1] == 'Hide and seek' then
        parse("sv_fow 0")
        end
    end
    for i = 1, 32 do
        parse("setarmor "..i.." 0")
        parse("speedmod "..i.." 0")
        for _, id in pairs(playerweapons(i)) do
            if id ~= 55 and id ~= 50 then
                parse("strip "..i.." "..id)
            end
        end
    end
end
 
function randomnow()
    randomnumber = math.random(1, #random_rounds)
    msg ('\169'..color_code['red']..random_rounds[randomnumber][1]..'\169'..color_code['yellow'].." round!")
end
 
function _sec()
    if endofround == false then
    for _, id in pairs(player(0, "tableliving")) do
		if randomnumber == 9 then
			parse ("equip "..id.." 73")
		elseif randomnumber == 10 then
			for _, wpn in ipairs (grenades) do
				parse ("equip "..id.." "..wpn)
			end
		end
    end
    end
end
       
function _start_pre()
    endofround = false
    randomnow()
    if randomnumber ~= nil then
		if random_rounds[randomnumber][3] == 2 then
			extra(id, random_rounds[randomnumber][3])
		elseif random_rounds[randomnumber][3] == 3 then
			parse("mp_hud 91")
		end
    end
    if random_rounds[randomnumber][1] == 'Hide and seek' then msg ("\169"..color_code['red'].."Terrorists are seekers while \169"..color_code['light blue'].."Counter-terrorists are hiders!") end
end
 
function _spawn(id)
        if randomnumber ~= nil and random_rounds[randomnumber][3] ~= nil and random_rounds[randomnumber][3] ~= 2 then extra(id, random_rounds[randomnumber][3]) end
        if randomnumber ~= nil then return random_rounds[randomnumber][2] end
end
 
function _buy(id)
        msg2(id, "\169"..color_code['red'].."You can't buy anything!@C")
        return 1
end
 
function extra(p, i)
        if i == 1 then
                if WTFround_speedmod then parse("speedmod "..p.." "..WTFround_speedmod_value) end
        elseif i == 2 then
                deagle_damage()
        elseif i == 3 then
                build_base (p)
        elseif i == 4 then
                parse ("speedmod "..p.." "..Rushround_speedmod_value)
        elseif i == 5 then
                hnsround (p)
                parse ("sv_fow 1")
        elseif i == 6 then
                parse ("sv_fow 1")
        end
end
 
function deagle_damage()
        if itemtype(3, "dmg") ~= 999 then parse("mp_wpndmg Deagle 999") else parse("mp_wpndmg Deagle 34") end
end
 
function build_base (p)
        parse ("setmoney "..p.." 16000")
end
 
function _walk()
        if endofround then return 1 end
end
 
function hnsround(p)
        if player(p, "team") == 1 then
                local random_weapon = math.random(1, #weapons_hns)
                parse ("equip "..p.." "..weapons_hns[random_weapon])
        end
end

Just look at this maybe, but this script isn't counting rounds, it randomize every rounds.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview