AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting 'array's from amxx native calls (https://forums.alliedmods.net/showthread.php?t=26371)

ShAyA 04-01-2006 01:11

Getting 'array's from amxx native calls
 
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.

teame06 04-01-2006 01:19

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

ShAyA 04-01-2006 02:02

Would this also include more then one dimensional arrays?

what about string arrays?

or would get_array in theory really cover string and array?

Freecode 04-01-2006 02:05

Quote:

Originally Posted by ShAyA
what about string arrays?

What??? a string is an array........

ShAyA 04-01-2006 02:11

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 :P

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?

BAILOPAN 04-01-2006 02:12

You cannot pass two dimensional arrays to natives.

ShAyA 04-01-2006 02:16

Quote:

Originally Posted by BAILOPAN
You cannot pass two dimensional arrays to natives.

DEAR LORD!!!!

How disappointing is that :oops:

Now my pawn code to solve the meaning of life is ruined, thanks :lol:

Twilight Suzuka 04-01-2006 10:10

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 ^~

BAILOPAN 04-01-2006 12:33

Quote:

Originally Posted by ShAyA
Quote:

Originally Posted by BAILOPAN
You cannot pass two dimensional arrays to natives.

DEAR LORD!!!!

How disappointing is that :oops:

Now my pawn code to solve the meaning of life is ruined, thanks :lol:

This is because size information is not passed along.

ShAyA 04-01-2006 18:37

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.


All times are GMT -4. The time now is 16:31.

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