SA-MP Forums Archive
Tag mismatch? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tag mismatch? (/showthread.php?tid=610350)



Tag mismatch? - FishyZ - 23.06.2016

Код:

//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] =



Re: Tag mismatch? - FishyZ - 23.06.2016

@Bump


Re: Tag mismatch? - MotherDucker - 23.06.2016

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 }
};



Re: Tag mismatch? - Dayrion - 23.06.2016

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.


Re: Tag mismatch? - FishyZ - 23.06.2016

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
};



Re: Tag mismatch? - FishyZ - 23.06.2016

Bump


Re: Tag mismatch? - MotherDucker - 23.06.2016

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


Re: Tag mismatch? - Vince - 23.06.2016

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.


Re: Tag mismatch? - Dutheil - 23.06.2016

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]);




Re: Tag mismatch? - FishyZ - 23.06.2016

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.