Forum

> > Carnage Contest > Error msg when testing new game-mode
Forums overviewCarnage Contest overviewLog in to reply

English Error msg when testing new game-mode

5 replies
To the start Previous 1 Next To the start

old Error msg when testing new game-mode

DannyDeth
User Off Offline

Quote
Hi there, I was wondering why Carnage Contest keeps giving me error msg with my new game-mode. It says that it is excpecting 'then' near the '=' but i don;t really see anything wrong with it. Here is the code

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
--------------------------------------------
-- Paintball Game-Mode for CC                  --
-- Script By Dannyeth, 2/3.Oct.2010          --
--------------------------------------------
-- Setup the tables and other stuff
if ccdd = nil then ccdd = {}
ccdd.pntbllmsk.gfx=loadgfx("gfx/paintmask.bmp")
players = playertable()
addgamemode("pntbll","PaintBall")


function pntbll_gm_draw()
	for i=0, #players do
		x = getplayerx(i)
		y = getplayery(i)
		drawimage(ccdd.pntbllmsk.gfx, x, y)
	end
end

function pntbll_gm_update()
	-- Do nothing...
end function

function pntbll_gm_playerdamage(id)
	return getplayerhealth(id) -- Kill the player instantly, this is paintball --
end

The error says it is in line 7, which is where i define the ccdd table. I can;t see anything wrong here, is it becuase i missed a ";" or what? I dont really know what is wrong as it looks fine to me.

EDIT: I have tried placing an "end" at the end of the line where i setup the ccdd table but i still get an error message.
edited 2×, last 03.10.10 01:04:51 pm

old Re: Error msg when testing new game-mode

DannyDeth
User Off Offline

Quote
It's ok Lua isn't hard at all, if you understand the basics of scripting/programming ( which you kinda of get from SII ) you won't have any trouble learning Lua. Maybe I will write you a specialised tutorial and send you a link for it

old Re: Error msg when testing new game-mode

Ultr4killer
BANNED Off Offline

Quote
DannyDeth has written
It's ok Lua isn't hard at all, if you understand the basics of scripting/programming ( which you kinda of get from SII ) you won't have any trouble learning Lua. Maybe I will write you a specialised tutorial and send you a link for it


I really dont wont to bother you wint this. But if you want you can send me.

old Re: Error msg when testing new game-mode

senar
User Off Offline

Quote
i think the wrong with here :
1
2
3
function pntbll_gm_update()
     -- Do nothing...
end function

edit it to :
1
2
3
function pntbll_gm_update()
     -- Do nothing...
end

old Re: Error msg when testing new game-mode

DannyDeth
User Off Offline

Quote
No, I found out what it was sorry i forgot to post that i found out. It was here:
1
if ccdd = nil then ccdd = {}
it is supposed to be:
1
if ccdd == nil then ccdd = {}

Whenever I make mistakes like this I feel like im dislexic
To the start Previous 1 Next To the start
Log in to replyCarnage Contest overviewForums overview