Moderators IIYAMA Posted November 16, 2012 Moderators Share Posted November 16, 2012 Hello guys, I have a very large table, but the problem is that 70% is "0" WeaponRecoil = {[0]=0,[1]=0,[2]=0,[3]=0,[4]=0,[5]=0..................ETC How can I make sure the table will be small. The numbers that will be something in the table is 0 t/m 47. (btw in some of my tables does have a "0", for sample you have explosion = 0 or unarmed = 0) A guy told me once, that I have to use "var" (remi-x) What is the best way to make a good table? Link to comment
denny199 Posted November 16, 2012 Share Posted November 16, 2012 I don't understand you. You want to make the table small? just something looks like this instead of 1=0, 2=0, 3=1, 4=0 etc.: 0 to 10 = 0 10 to 20 = 1 11 to 15 = 0 etc. etc. I hope that you will understand me to ;p Link to comment
myonlake Posted November 16, 2012 Share Posted November 16, 2012 Perhaps don't make a table for all weapons if you don't want to change them from zero to anything. Only make a table for the weapons you want to change. Link to comment
Renkon Posted November 16, 2012 Share Posted November 16, 2012 You can use 'nil', unless I'm wrong Link to comment
Moderators IIYAMA Posted November 16, 2012 Author Moderators Share Posted November 16, 2012 How do you set a table like that? denny199 0 to 10 = 0 10 to 20 = 1 11 to 15 = 0 etc. etc. I get errors if I call a weapon/number, that does not exist in the table it self. Sample: I ask for 3, but the table is: omfg = {1=[1],2=[2]} -- 3 isn't inside. myonlake Perhaps don't make a table for all weapons if you don't want to change them from zero to anything. Only make a table for the weapons you want to change. How can I check with nil if the number isn't inside? Renkon You can use 'nil', unless I'm wrong Link to comment
Renkon Posted November 16, 2012 Share Posted November 16, 2012 if (table) == nil then Link to comment
Anderl Posted November 16, 2012 Share Posted November 16, 2012 IIYAMA said: How do you set a table like that? denny199 0 to 10 = 0 10 to 20 = 1 11 to 15 = 0 etc. etc. I get errors if I call a weapon/number, that does not exist in the table it self. Sample: I ask for 3, but the table is: omfg = {1=[1],2=[2]} -- 3 isn't inside. myonlake Perhaps don't make a table for all weapons if you don't want to change them from zero to anything. Only make a table for the weapons you want to change. How can I check with nil if the number isn't inside? Renkon You can use 'nil', unless I'm wrong It's { [1] = 1, [2] = 2 } not { 1 = [1], 2 = [2] }. Link to comment
Moderators IIYAMA Posted November 16, 2012 Author Moderators Share Posted November 16, 2012 ops sorry , just a sample :3 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now