Forum

> > CS2D > Scripts > Map vote lua error?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Map vote lua error?

17 replies
To the start Previous 1 Next To the start

old Map vote lua error?

Kirito2K
User Off Offline

Quote
Hi folks,
I have a problem in my script's server.
When a player votes for a map , a hud shows with count down to 0 then map should change but instead it start counting -1 -2 -3 -4 ..
And none can enter the server..

I hope u can get solution for the script.
Script >


PS : I use hc admin script edited .

old Re: Map vote lua error?

Rainoth
Moderator Off Offline

Quote
You find a word "if" then you click the button "Tab" before it. You find ANOTHER "if" after it, you click button "Tab" twice before it.
1
2
3
4
5
6
7
if then
	if then
		if then
			command
		end
	end
end

old Re: Map vote lua error?

Rainoth
Moderator Off Offline

Quote
It's one of the things you do if you want others to help you.
Technically, I could just write the whole script in one line. Do you think that would be okay? Same thing here. Tab your code, it makes it a lot more readable. In some cases you may even find the reason for the error (missing 'end' and so on)

Just do it.

old Re: Map vote lua error?

Nekomata
User Off Offline

Quote
It's importance because your code is more clean and understandable. For example if you've got 5 ifs within another if; other developers won't be looking hard to find the 'end' of it (get da pun?) because it'll be tabbed and vertically below it.

old Re: Map vote lua error?

Bowlinghead
User Off Offline

Quote
Helping doesnt mean we do all the work for you.
For the most part your code is TABbed already.

Everything with an "end" (function, if, for, ...) is a block. And everything in that block gets an TAB. You use TAB in almost every computer language.
Line 210 - 237:
Ugly >

Fancy >
edited 1×, last 24.05.15 06:29:10 pm

old Re: Map vote lua error?

Kirito2K
User Off Offline

Quote
@user Danilwra: I didn't steal it , ur just dump i said that i use it in my server and i have a error

@user Bowlinghead: Ok so i understand the reason of using tabbing , after tabbing what i could do ?

Script with tabbing >
edited 3×, last 26.05.15 05:00:12 pm

old Re: Map vote lua error?

XoOt
Super User Off Offline

Quote
@user Danilwra: thats not correct.
Not everyone is able to solve selfmade mistakes, therefore he did the only right task to ask for help. He will learn and improve by time so dont expect too much.

old Re: Map vote lua error?

Bowlinghead
User Off Offline

Quote
I don´t want to look through these 300 lines of code without a single commant.

Between line 184 and 185 type this:
1
voteend = 0
Maybe it will fix it; maybe not.

Btw:
You used a [ / quote] at the end of your post. So your code isn´t displayed as code and you didn´t tabbed it as well (you just copy& pasted my example...)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview