Tag mismatch?
#1

Код:

//Pizza Job
new Float: PizzamanCPs[5][4] =
{
  { 2236.3997,167.3553,28.1535, 3 },
  { 2363.3560,116.1356,28.4416, 3 },
  { 2374.1240,42.2868,28.4416, 3 },
  { 2392.2939,-54.9637,28.1536, 3 },
  { 1291.9042,281.5284,19.5614, 3 },
  { 1277.0186,370.8626,19.5547, 3 },
  { 1352.0980,348.4374,20.5009, 3 },
  { 1402.4236,286.2011,19.5547, 3 }
};
I'm getting these errors

Код:
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(59) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(60) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(61) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(62) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(63) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(64) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(65) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(66) : warning 213: tag mismatch
C:\Users\Fishy\Desktop\New folder (2)\gamemodes\ROLEPLAY.pwn(67) : error 052: multi-dimensional arrays must be fully initialized
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Also can anyone explain what I should put on these [][] and what do they mean?
Код:
new Float: PizzamanCPs[5][4] =
Reply
#2

@Bump
Reply
#3

Firstly, please can you show me the code which the errors occur on?

Secondly, take a look at this topic made by iPLEOMAX: https://sampforum.blast.hk/showthread.php?tid=318212
Basically, the first dimension is the number of rows which are in the array, and the second dimension is the number of columns there are for example, characters within the string.

In your case, you have 8 different rows, and the longest string or floats in this case has 4 characters, so your code should look like..
Код:
new Float: PizzamanCPs[8][4] =
{
  { 2236.3997,167.3553,28.1535, 3 },
  { 2363.3560,116.1356,28.4416, 3 },
  { 2374.1240,42.2868,28.4416, 3 },
  { 2392.2939,-54.9637,28.1536, 3 },
  { 1291.9042,281.5284,19.5614, 3 },
  { 1277.0186,370.8626,19.5547, 3 },
  { 1352.0980,348.4374,20.5009, 3 },
  { 1402.4236,286.2011,19.5547, 3 }
};
Reply
#4

Try this :
PHP код:
new Float:PizzamanCPs[8][4] =
{
  { 
2236.3997,167.3553,28.1535},
  { 
2363.3560,116.1356,28.4416},
  { 
2374.1240,42.2868,28.4416},
  { 
2392.2939,-54.9637,28.1536},
  { 
1291.9042,281.5284,19.5614},
  { 
1277.0186,370.8626,19.5547},
  { 
1352.0980,348.4374,20.5009},
  { 
1402.4236,286.2011,19.5547}
}; 
You have to show us each line with tag mismatch to help you.
Reply
#5

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Try this :
PHP код:
new Float:PizzamanCPs[8][4] =
{
  { 
2236.3997,167.3553,28.1535},
  { 
2363.3560,116.1356,28.4416},
  { 
2374.1240,42.2868,28.4416},
  { 
2392.2939,-54.9637,28.1536},
  { 
1291.9042,281.5284,19.5614},
  { 
1277.0186,370.8626,19.5547},
  { 
1352.0980,348.4374,20.5009},
  { 
1402.4236,286.2011,19.5547}
}; 
You have to show us each line with tag mismatch to help you.
The Lines are 59 to 66, all in order (59,60,61)
which are these lines

Код:

new Float:PizzamanCPs[8][4] =
{
  { 2236.3997,167.3553,28.1535, 3 }, //line 59
  { 2363.3560,116.1356,28.4416, 3 },
  { 2374.1240,42.2868,28.4416, 3 },
  { 2392.2939,-54.9637,28.1536, 3 },
  { 1291.9042,281.5284,19.5614, 3 },
  { 1277.0186,370.8626,19.5547, 3 },
  { 1352.0980,348.4374,20.5009, 3 },
  { 1402.4236,286.2011,19.5547, 3 } //line 66
};
Reply
#6

Bump
Reply
#7

Have you tried to recompile already? because it should work.
Reply
#8

You declare the array with the Float tag. However '3' is not a float and throws the warning. Either declare it as '3.0' or find another way to do what you want. Also you do not need to explicitly state the size of the array dimensions in this case (the number between square brackets). The compiler is perfectly capable of counting.
Reply
#9

PHP код:
stock const
    
PizzamanCPs[][] = 
    { 
        {
float:2236.3997float:167.3553float:28.15353}, 
        {
float:2363.3560float:116.1356float:28.44163}, 
        {
float:2374.1240float:42.2868float:28.44163}, 
        {
float:2392.2939float:-54.9637float:28.15363}, 
        {
float:1291.9042float:281.5284float:19.56143}, 
        {
float:1277.0186float:370.8626float:19.55473}, 
        {
float:1352.0980float:348.4374float:20.50093}, 
        {
float:1402.4236float:286.2011float:19.55473
    }; 
You can try this, with this code :
PHP код:
#include "a_samp"
stock const
    
PizzamanCPs[][] = 
    { 
        {
float:2236.3997float:167.3553float:28.15353}, 
        {
float:2363.3560float:116.1356float:28.44163}, 
        {
float:2374.1240float:42.2868float:28.44163}, 
        {
float:2392.2939float:-54.9637float:28.15363}, 
        {
float:1291.9042float:281.5284float:19.56143}, 
        {
float:1277.0186float:370.8626float:19.55473}, 
        {
float:1352.0980float:348.4374float:20.50093}, 
        {
float:1402.4236float:286.2011float:19.55473
    };
main()
{
    for(new 
0sizeof(PizzamanCPs); i++)
        
printf("%f, %f, %f, %d"PizzamanCPs[i][0], PizzamanCPs[i][1], PizzamanCPs[i][2], PizzamanCPs[i][3]);

Reply
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
You declare the array with the Float tag. However '3' is not a float and throws the warning. Either declare it as '3.0' or find another way to do what you want. Also you do not need to explicitly state the size of the array dimensions in this case (the number between square brackets). The compiler is perfectly capable of counting.
Thank you, +Repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)