Raised This Month: $ Target: $400
 0% 

Pawn function argmunent help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-23-2014 , 14:45   Re: Pawn function argmunent help
Reply With Quote #4

There's probably an easier way to do the multi-dimensional array but I can't figure it out.
This only works with a multi-dimensional array that have a predetermined size at the top level and mid level. If you increase the array size on either of them it will fail on compilation.
Bug? No idea.

It may be easier to use a dynamic native. But either way you have to pass the size of the array to the subfunction.

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Test Plugin 8", "", "[ --{-@ ]");         new array[1][1][1];     test();     test(array);     test(array, "what"); } stock test(array2d[][][]={{{0}}}, optionalvalue[]="") {     server_print("%d", array2d[0][0][0]);     server_print("Optional: %s", optionalvalue); }
__________________

Last edited by Black Rose; 05-23-2014 at 14:53.
Black Rose is offline
 



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:45.


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