Forum

> > CS2D > Scripts > Lua Scripts/Questions/Help
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Scripts/Questions/Help

6,770 replies
Page
To the start Previous 1 284 85 86338 339 Next To the start

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
nice script by the way, I should put some critical shot in BF2D when higher rank >.>

EDIT:

I got lame error when making script, here it is

Spoiler >


what is unfinished long comment near <eof> ? I don't know the problem, I already re-check my script 6 times, but I still don't get the problem, someone could help me?
edited 1×, last 10.11.09 09:46:18 am

old Re: Lua Scripts/Questions/Help

AimZ
User Off Offline

Quote
can someone help me out?
i need to know how i can change the @say user priv
example: someone logs in as vip but when they use @say it says admin how can i change that to vip like LaG Servers.

old Re: Lua Scripts/Questions/Help

sonnenschein
User Off Offline

Quote
Admirdee has written
nice script by the way, I should put some critical shot in BF2D when higher rank >.>

EDIT:

I got lame error when making script, here it is

Spoiler >


what is unfinished long comment near <eof> ? I don't know the problem, I already re-check my script 6 times, but I still don't get the problem, someone could help me?

did you put any comments near end of line?

old Re: Lua Scripts/Questions/Help

FLATRON
User Off Offline

Quote
Help please, whether it is possible as that to make that with level of the player - the loss from its weapon increased?
For example:
Ak-47 = an initial loss an example 5
And with each level increased on 1?

Help me please

And still here when we come on a server, to us suggest to choose a kind of the player - what command for it answers? Well that is here it is necessary to me that the boat was certain looked =))

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
@Blazzingxx

1
2
3
4
5
6
7
8
9
10
11
12
13
[spoiler]addhook("always","always")
function always(id)
	local i = 1,32 do
		if (player(i,"exists")) then
			updatehud(id)
			updaterank(id)
			updatemoney(id)
			updatefrag(id)
			updatedeath(id)
			updatetile(id)
		end
	end
end[/spoiler]

here's the last code

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
@Admirdee,
Always hook, doesn't have ID parameter.

And problem is "local i = 1,32"
It should be for i = 1,32

Hell, it's full of beginer mistakes.

It should like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("always","always")
function always()
	local i 
	for i = 1,32 do
		if (player(i,"exists")) then
			updatehud(i)
			updaterank(i)
			updatemoney(i)
			updatefrag(i)
			updatedeath(i)
			updatetile(i)
		end
	end
end

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
well, thanks for that
but the problem not solved

same problem =.=

EDIT:

give some minutes, I need to recheck it
edited 1×, last 10.11.09 01:35:42 pm

old Re: Lua Scripts/Questions/Help

SQ
Moderator Off Offline

Quote
There was so bugs, I guess on off them could be in functions you made.

1
2
3
4
5
6
updatehud(i)
updaterank(i)
updatemoney(i)
updatefrag(i)
updatedeath(i)
updatetile(i)

Send script on PM, i will check.

old Re: Lua Scripts/Questions/Help

Admir
User Off Offline

Quote
Blazzingxx has written
And problem is "local i = 1,32"
It should be for i = 1,32


I all do "local i = 1,32" its work,
previous version was work like this
1
2
3
4
5
6
7
8
9
function updatetile(id)
local i = 1,32 do
	if(player(i,"exists")) then
	xm = player(i,"tilex")
	ym = player(i,"tiley")
		hudtext2(i,9,'000255000','X: '..xm..' Y: '..ym,13,105)
	end
end
end

nvm I send the script too

EDIT:

nvm, it's work again, some comments forget to put ending,
my eyes blurring

old Re: Lua Scripts/Questions/Help

CarbonLord
User Off Offline

Quote
Hi everyone
I am new here.. I think you can help me.
I gonna start.
Can someone do a script for me...
I want to do a Space battle something mod.
Can anyone do for me a script, that CT have got name hmmm... Galactic troopers or something, and TT have got name hmm... Confederacy or something.
And there must (please ) be a level script.
And, the last one, classes.
Marine (slower, but nice weapon on a start... maybe galil or something)
Pilot (faster, but only deagle on a start)
Can you do, that only pilots can open some doors? Exactly doors to starfighter?
Thanks for help
~Carbon

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Admirdee has written
I all do "local i = 1,32" its work,


It's not about making it work, you have to know what you are doing, i=1,32 makes no sense.
When you try your script with people you will see your mistake...

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
Nope
1
local = 1,32
declares a variable and gives it the value 1

1
for i=1,[b]32[/b] do
Starts a loop that means that the script between the "do" and the next "end" will be executed and i will increase by 1. The script will be executed again, and over and over again as long as i isn't bigger than the bolded number(32 in this case).

You could also do things like
1
for i=1,32[b],2[/b]
to make the i variable increase by two.
Or
1
for i=[b]5[/b],37
to make i start with the value 5 instead of 1

EDIT: Take in count that you can't use the i variable outside the loop
edited 1×, last 11.11.09 12:11:21 am

old Re: Lua Scripts/Questions/Help

Flacko
User Off Offline

Quote
CmDark has written
my script takes like forever to get to the random number which means like (?1hour) to get 1 critical hit number


Uhmm... would you post your script?
To the start Previous 1 284 85 86338 339 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview