Array Sizes do not match
Lines 639-640:
Code:
get_user_origin ( i, origin[3] );Code:
public FS_Should_Burn_Victim ( origin[], burnvec1[], burnvec2[], radius, i, id, ff )Code:
error 47: array sizes do not match...Initialization of origin: Code:
new origin[33][3];http://forums.alliedmods.net/showthr...%22array+sizes www.doomworld.com/eternity/engine/smalldoc.pdf Slmclarengt |
Re: Array Sizes do not match
Hi,
i think i know what is wrong in your script.. Code:
first: get_user_origin ( i, origin[i]);If you declare a array origin[3] you can do just get_user_origin(id, origin) To send the array as a parameter in a function call just do function(origin) And if you got an array origin[33][3] just declare the first dimension like get_user_origin(id, origin[id]) and function(origin[id]) Hope that helps :) greetz regalis |
Re: Array Sizes do not match
The problem is pretty self explanatory.
As regalis said you are not setting origin correctly! For retrieving and setting data it should have origin[id] since it is a 2 dimensional array. Ideally you should use a declared size for arrays in your function. 1) For error checking if you try going beyond the size 2) So Pawn knows exactly how much memory to allocate. Code:
|
Re: Array Sizes do not match
Thank you both for your help, but I still have not been able to remove that error.
Here's more code because I substituted what you guys said in, both ways, and neither worked: PHP Code:
PHP Code:
|
Re: Array Sizes do not match
Are you sure that there have to be two times "i" in there?
Code:
if ( ( get_distance ( origin[i], burnvec1 ) < radius ) || ( get_distance ( origin[i], burnvec2 ) < radius ) ) Too tired right now. Everything else looks good so far i can see... greetz regalis |
Re: Array Sizes do not match
I don't know what I need and what I don't because this is confusing me really badly. I have tried re-reading all docs/information on this subject but I think I just need someone else to help me with the issue directly.
Slmclarengt |
Re: Array Sizes do not match
I'm pretty sure it will be the function headers..
Instead of being origin[], make it origin[3] etc etc. [] is for strings, since vectors have a fixed sized you should specify this. |
Re: Array Sizes do not match
1) Verry sloppy for loop
2) Why did you do this PHP Code:
3) The root of the problem is in here PHP Code:
|
Re: Array Sizes do not match
Quote:
Current Code: PHP Code:
PHP Code:
Slmclarengt |
Re: Array Sizes do not match
One more thing:
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 10:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.