Forum

> > CS2D > Scripts > Gungame error
Forums overviewCS2D overview Scripts overviewLog in to reply

English Gungame error

2 replies
To the start Previous 1 Next To the start

old Gungame error

BistecaCrua
User Off Offline

Quote
I'm starting to learn how to edit luascripts, today I was editing the Gungame that comes with the game, just edited the weapons and an error occurred.
It works normal when it comes more in the last guns, flamethrowers, grenade launchers, and the knife, if I die I reborn with USP (when am CT) and Glock (when I am TR), this may be because I changed the weapons of gungame?

Sorry if have error in English

Here is what I edited:

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
--------------------------------------------------
-- Gun Game Script by Unreal Software           --
-- 11.03.2009 - www.UnrealSoftware.de           --
-- Adds Player Classes to your server           --
--------------------------------------------------

if sample==nil then sample={} end
sample.gg={}

-----------------------
-- INITIAL SETUP     --
-----------------------
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end

-- Level
sample.gg.level=initArray(32)

-- Kill Counter
sample.gg.kills=initArray(32)

-- Weapons for different Levels
sample.gg.wpn={4,3,21,22,24,39,30,32,35,10,46,49,50}
^This was the part that I changed^

-- Game Settings
parse("sv_gamemode 1")		-- Deathmatch
parse("mp_randomspawn 1")	-- Random Spawning
parse("mp_infammo 1")		-- Infinite Ammo


-----------------------
-- STARTROUND        --
-----------------------
addhook("startround","sample.gg.start")
function sample.gg.start()
	-- Reset Values
	local i
	for i=1,32 do
		sample.gg.level[i]=1
		sample.gg.kills[i]=0
		-- Reset Weapon (Kill)
		if (player(i,"exists")) then
			-- Strip All Weapons (0)
			parse("strip "..i.." 0")
			-- Give first Weapon
			parse("equip "..i.." "..sample.gg.wpn[1])
			-- Strip Knife
			parse("strip "..i.." 50")
		end
	end
end

-----------------------
-- JOIN              --
-----------------------
addhook("join","sample.gg.join")
function sample.gg.join(id)
	-- Reset
	sample.gg.level[id]=1
	sample.gg.kills[id]=0
end


-----------------------
-- SPAWN             --
-----------------------
addhook("spawn","sample.gg.spawn")
function sample.gg.spawn(id)
	-- Minimum Level is 1
	if (sample.gg.level[id]<1) then
		sample.gg.level[id]=1
	end
	-- Remove Knife
	if (sample.gg.level[id]<10) then
		parse("strip "..id.." 50")
	end
	-- Equip with Weapon for current Level
	if (sample.gg.level[id]>0 and sample.gg.level[id]<=10) then
		return sample.gg.wpn[sample.gg.level[id]]
	end
end

-----------------------
-- KILL              --
-----------------------
addhook("kill","sample.gg.kill")
function sample.gg.kill(id)
	-- Add Kill
	sample.gg.kills[id]=sample.gg.kills[id]+1
	-- Next Level?
	if (sample.gg.kills[id]>=2) then
		-- Reset Kills
		sample.gg.kills[id]=0
		-- Increase Level
		sample.gg.level[id]=sample.gg.level[id]+1
		-- Win?
		if (sample.gg.level[id]>=#sample.gg.wpn) then
			msg("©000255000"..player(id,"name").." has won the game!@C")
			parse("restart")
		else
			-- Give new Weapon
			parse("equip "..id.." "..sample.gg.wpn[sample.gg.level[id]])
			-- Remove last Weapon
			parse("strip "..id.." "..sample.gg.wpn[sample.gg.level[id]-1])
		end
	end
	-- Info
	if (sample.gg.level[id]<11) then
		msg2(id,"Level: "..sample.gg.level[id].." Kills: "..sample.gg.kills[id])
	end
end


-----------------------
-- NO BUYING         --
-----------------------
addhook("buy","sample.gg.buy")
function sample.gg.buy()
	return 1
end


-----------------------
-- NO COLLECTING     --
-----------------------
addhook("walkover","sample.gg.walkover")
function sample.gg.walkover(id,iid,type)
	if (type>=61 and type<=68) then
		return 0
	end
	return 1
end


-----------------------
-- NO DROPPING       --
-----------------------
addhook("drop","sample.gg.drop")
function sample.gg.drop()
	return 1
end


-----------------------
-- NO DEAD DROPPING --
-----------------------
addhook("die","sample.gg.die")
function sample.gg.die()
	return 1
end

old Re: Gungame error

Deleted User

Quote
I believe that you have inserted the IDs that doesn't exists.

old Re: Gungame error

TopNotch
User Off Offline

Quote
If you just edited the items, remove 50 (knife) in line 28, maybe that would help.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview