Forum

> > Carnage Contest > Error msg when testing new game-mode
ForenübersichtCarnage Contest-ÜbersichtEinloggen, um zu antworten

Englisch Error msg when testing new game-mode

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Error msg when testing new game-mode

DannyDeth
User Off Offline

Zitieren
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.
2× editiert, zuletzt 03.10.10 13:04:51

alt Re: Error msg when testing new game-mode

DannyDeth
User Off Offline

Zitieren
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

alt Re: Error msg when testing new game-mode

Ultr4killer
BANNED Off Offline

Zitieren
DannyDeth hat geschrieben
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.

alt Re: Error msg when testing new game-mode

senar
User Off Offline

Zitieren
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

alt Re: Error msg when testing new game-mode

DannyDeth
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenCarnage Contest-ÜbersichtForenübersicht