Forum

> > CS2D > Scripts > Arrays
Forums overviewCS2D overview Scripts overviewLog in to reply

English Arrays

16 replies
To the start Previous 1 Next To the start

old Arrays

Suprise
BANNED Off Offline

Quote
Yeah name rocks. So

I have a big script. I dont want post the whole only what i want:

1
2
3
4
5
6
7
8
9
10
function Array(size,value) 
    local array = {}
    for i = 1, size do
        array[i]=value
		return array
    end
end

mute=Array(32)
colors = {}

So the script have mute function and Say color function (Yay) but if I remove array, mute script doesnt work but if there is "return array" then Say color doesn't work. Hope you understand. Help mah please.

old Re: Arrays

Suprise
BANNED Off Offline

Quote
I only post you guys the importanat parts.

Spoiler >


P.S I'll relase this that's why i dont want to show the whole script.
edited 1×, last 25.06.12 06:12:55 pm

old Re: Arrays

Yates
Reviewer Off Offline

Quote
HOLY SHIT LOADS OF BUTTONS. BUTTONS EVERYWHERE.

old Re: Arrays

Yates
Reviewer Off Offline

Quote
Merge the two say functions together. As I know you have more than one, otherwise this wouldn't happen.

old Re: Arrays

Suprise
BANNED Off Offline

Quote
No i have only 1 'colorsay' function.

1
2
3
4
5
6
7
8
9
10
function Array(size,value) 
local array = {}
for i = 1, size do
array[i]=value
          return array
end
end

mute=Array(32)
colors = {}

On this first picture no works.
But on the second picture script is work but I can't use mute. I removed return array and say color works, mute not.

IMG:https://i40.servimg.com/u/f40/17/30/54/57/de_dus10.jpg


IMG:https://i40.servimg.com/u/f40/17/30/54/57/de_dus11.jpg

old Re: Arrays

krabob
User Off Offline

Quote
Your script disgusts me, don't edit crazybooy's.

Better make one yourself from scratch

old Re: Arrays

Alistaire
User Off Offline

Quote
user Suprise has written
1
2
3
4
addhook("say","ifmuted")
addhook("menu","admmenu4")
addhook("menu","admmenu10")
addhook("say","colorsay")


How exactly do YOU think that will work?

old Re: Arrays

sheeL
User Off Offline

Quote
user krabob has written
Your script disgusts me, don't edit crazybooy's.

Better make one yourself from scratch


Don't edit other scripts ...

old Re: Arrays

Suprise
BANNED Off Offline

Quote
What. This isn't edit its my own work guys.

@user Alistaire: Why what's the problem with them?

old Re: Arrays

Alistaire
User Off Offline

Quote
user Suprise has written
What. This isn't edit its my own work guys.

@user Alistaire: Why what's the problem with them?


I hope you know you can't add multiple functions to a hook. Just hope, but I'm afraid you do not.

old Re: Arrays

Yates
Reviewer Off Offline

Quote
user Suprise has written
@user Alistaire: Why what's the problem with them?

Two say hook, two functions. Merge them together so you end up with 1 hook and 1 function.

If you still have the same problem make sure to return 0 if the command is mute.

old Re: Arrays

Suprise
BANNED Off Offline

Quote
Ahh thanks you very much Yates and Alistaire. You guys saved my project.

old Re: Arrays

krabob
User Off Offline

Quote
Okay combine the functions and also add the array to "colors"

edit: too late
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview