Raised This Month: $51 Target: $400
 12% 

Filling a double dimensional array


Post New Thread Reply   
 
Thread Tools Display Modes
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-23-2017 , 16:21   Re: Filling a double dimensional array
Reply With Quote #11

Quote:
Originally Posted by eyal282 View Post
I'm quite sure it's handled automatically.
How?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2017 , 01:02   Re: Filling a double dimensional array
Reply With Quote #12

Anything that is indexed by a player's entity id will always need to be set on connect or putinserver. There is no reason to do otherwise (unless you want a plugin that is really glitchy and won't work correctly).
__________________
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-24-2017 , 02:53   Re: Filling a double dimensional array
Reply With Quote #13

I'm pretty aware of that, thanks, but I still want to know how to fill a double dimensional array..
__________________
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-24-2017 , 03:20   Re: Filling a double dimensional array
Reply With Quote #14

Quote:
Originally Posted by Depresie View Post
I'm pretty aware of that, thanks, but I still want to know how to fill a double dimensional array..
your first question was how to declare with a default value, filling is something different.

MyArray[ First_D] [ Second_d ] = Value,

Example

MyArray[33][33]

Each first dimension will have another 33 dimensions, example:

Code:
MyArray
{
	MyArray[0]
	{
		[0]
		[1]
 		[2]
		... until 33
	}

	MyArray[1]
	{
		[0]
		[1]
		...
	}
	...
	MyArray[33]...
}
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-24-2017 , 05:42   Re: Filling a double dimensional array
Reply With Quote #15

Quote:
Originally Posted by Depresie View Post
I'm pretty aware of that, thanks, but I still want to know how to fill a double dimensional array..
https://www.amxmodx.org/api/amxmodx/arrayset
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 06-24-2017 , 06:20   Re: Filling a double dimensional array
Reply With Quote #16

Natesh, arrayset is for the whole array, and is useles for what he need.

The best option is as fysiks or whoever said to set its value at connect&disconnect.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2017 , 13:39   Re: Filling a double dimensional array
Reply With Quote #17

To simply set default values when you declare the array you do this:

Code:
new myArray[2][2] = {{1, 2}, {3, 4}}
Otherwise, you need to set the elements individually.

Everyone probably thinks this is trivial but you don't seem to want the most realistic answer.
__________________
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-24-2017 , 18:59   Re: Filling a double dimensional array
Reply With Quote #18

Already tried before like the following, i was getting the same error..
PHP Code:

new array[33][31] = { {1.0, ...}, ... } 
__________________
Depresie is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-24-2017 , 19:19   Re: Filling a double dimensional array
Reply With Quote #19

Quote:
Originally Posted by Depresie View Post
Already tried before like the following, i was getting the same error..
PHP Code:

new Float:array[33][31] = { {1.0, ...}, ... } 

it compiles fine...

PHP Code:
new Float:xArray[32][16] = { { 1.0, ... }, ... } 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 06-24-2017 at 19:30.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 06-25-2017 , 02:12   Re: Filling a double dimensional array
Reply With Quote #20

Quote:
Originally Posted by Natsheh View Post
it compiles fine...

PHP Code:
new Float:xArray[32][16] = { { 1.0, ... }, ... } 
Try to use this variable somewhere in the code.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode