Raised This Month: $ Target: $400
 0% 

Getting 'array's from amxx native calls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShAyA
Member
Join Date: Oct 2005
Old 04-01-2006 , 01:11   Getting 'array's from amxx native calls
Reply With Quote #1

If my title makes sence ><

I'm doing an AMXx native in amxx and I know theres get_param
but what about get_param_string or get_param_array, etc.

Thanks.
ShAyA is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-01-2006 , 01:19  
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=833

http://www.amxmodx.org/funcwiki.php?go=func&id=825

There a bunch of them.. Look inside of amxmodx.inc for the rest
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
ShAyA
Member
Join Date: Oct 2005
Old 04-01-2006 , 02:02  
Reply With Quote #3

Would this also include more then one dimensional arrays?

what about string arrays?

or would get_array in theory really cover string and array?
ShAyA is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 04-01-2006 , 02:05  
Reply With Quote #4

Quote:
Originally Posted by ShAyA
what about string arrays?
What??? a string is an array........
Freecode is offline
ShAyA
Member
Join Date: Oct 2005
Old 04-01-2006 , 02:11  
Reply With Quote #5

Quote:
Originally Posted by Freecode
Quote:
Originally Posted by ShAyA
what about string arrays?
What??? a string is an array........
in other words a two dimensional array

but lets say

you have charName[][]

example

charName[0][] = "Monkey";
charName[1][] = "Ape";
setCharName(charName);

would it just be:
get_array(1, charNames, 34);

how would it all work out?
ShAyA is offline
BAILOPAN
Join Date: Jan 2004
Old 04-01-2006 , 02:12  
Reply With Quote #6

You cannot pass two dimensional arrays to natives.
__________________
egg
BAILOPAN is offline
ShAyA
Member
Join Date: Oct 2005
Old 04-01-2006 , 02:16  
Reply With Quote #7

Quote:
Originally Posted by BAILOPAN
You cannot pass two dimensional arrays to natives.
DEAR LORD!!!!

How disappointing is that

Now my pawn code to solve the meaning of life is ruined, thanks
ShAyA is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-01-2006 , 10:10  
Reply With Quote #8

You can, in theory, simply pass the first index of the double array by reference, then use pointer math to put it to the correct index, and convert it afterwards.

This is why I asked for those natives BAIL ^~
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
BAILOPAN
Join Date: Jan 2004
Old 04-01-2006 , 12:33  
Reply With Quote #9

Quote:
Originally Posted by ShAyA
Quote:
Originally Posted by BAILOPAN
You cannot pass two dimensional arrays to natives.
DEAR LORD!!!!

How disappointing is that

Now my pawn code to solve the meaning of life is ruined, thanks
This is because size information is not passed along.
__________________
egg
BAILOPAN is offline
ShAyA
Member
Join Date: Oct 2005
Old 04-01-2006 , 18:37  
Reply With Quote #10

Twilight, mind an example?

Bailopan:
But not knowing the size,
isnt that as simple providing the size then?

setCharName(charName, 2, 34)
?

with a get_array which is like get_array(charName, 0, 34)
would get me 'Monkey'

and get_array(charName, 1, 34) would get 'Ape'

Btw, yes make shexy natives.
ShAyA 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 16:31.


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