Raised This Month: $ Target: $400
 0% 

dynamic array in amxx, what else can i use instead?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-20-2009 , 08:34   dynamic array in amxx, what else can i use instead?
Reply With Quote #1

so i heard that you can't use dynamic arrays here, the question is what to use instead? i need a dynamic one demensional integer array like
PHP Code:
int my_array[] 
so what can you suggest?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-20-2009 , 09:38   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #2

Use the CellArrays provided with AMXX.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-20-2009 , 11:04   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #3

that would be troublesome =\
can we edit cells in CellArrays? =\

wouldn't it be better if i just limit my int array with a big size?
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-20-2009 , 14:15   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #4

Show me what you are trying to do and I'll show you how to do it with CellArrays.
A large array is unnecessary.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-20-2009 , 16:07   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #5

i know that can be done with cellarray but with a much longer way (isn't that a resource-wasting way also?)

i need to add 1 to all cells from specific cell in the middle, and i need to access cell values by their position, with cellarray you have to get data from cell, then read it, why large array is unnecesarry? it doesn't take much or does it? a 10 000 empty cells array won't do much
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-20-2009 , 16:54   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #6

A 10,000 cell array... are you kidding me?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 08-21-2009 , 03:57   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #7

why not? =\
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-21-2009 , 03:59   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #8

Show me what you are using it for.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-21-2009 , 21:06   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #9

A lot of people say to use the dynamic cell arrays provided with amxx, but I'm not exactly sure how to use them effectively, because I can't find any tutorials.



For starters, I just want to have an array I can keep putting things in. Can I do this?

PHP Code:
Array:CoolArray=ArrayCreate(1,1
And then just keep putting them in with

PHP Code:
ArrayPushCell(Array,input


Edit: So I have it doing what I want it to now, but I still wish there was a tutorial, because I know I'm missing out on a lot of possible functionality with it.

...

If I have an array for each player, will cleararray remove all the cells that pushcell has created, or should I destroy the array and then make a new one on player connection?
__________________

Last edited by Bad_Bud; 08-21-2009 at 21:37.
Bad_Bud is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-22-2009 , 02:28   Re: dynamic array in amxx, what else can i use instead?
Reply With Quote #10

amxmodx\scripting\testsuite\arraytest.sma provides some examples about Array use(set/get values/sort...)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
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 15:04.


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