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=653222)



tag mismatch - SeanDenZYR - 29.04.2018

pawn Код:
new Float:qu[3];
HouseInfo[id][hPosX] = dini_Float(file, "HousePosX");
HouseInfo[id][hPosY] = dini_Float(file, "HousePosY");
HouseInfo[id][hPosZ] = dini_Float(file, "HousePosZ");
       
format(hString, sizeof(hString), "{0077FF}[{FFFFFF}%s's House{0077FF}]\n{0077FF}ID: {FFFFFF}%d", HouseInfo[id][hOwner], HouseInfo[id][hID]);
HouseInfo[id][hTextLabel] = CreateDynamic3DTextLabel(hString, -1, HouseInfo[id][hPosX], HouseInfo[id][hPosY], HouseInfo[id][hPosZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseInfo[id][hVirtualWorld], HouseInfo[id][hInterior], -1, 100.0);
i am getting a tag mismatch on this line

pawn Код:
HouseInfo[id][hTextLabel] = HouseInfo[id][hTextLabel] = CreateDynamic3DTextLabel(hString, -1, HouseInfo[id][hPosX], HouseInfo[id][hPosY], HouseInfo[id][hPosZ], 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, HouseInfo[id][hVirtualWorld], HouseInfo[id][hInterior], -1, 100.0);
it compiles as "tag mismatch" is only a warning, i didn't try it ingame yet but i am worrying it might not work.

here my enum for the HouseInfo if you need it

pawn Код:
enum hEnum {
    hID,
    hOwner,
    Float:hPosX,
    Float:hPosY,
    Float:hPosZ,
    hRentPrice,
    hBuyable,
    hPrice,
    hRentable,
    hTextLabel[500],
    hVirtualWorld,
    hInterior,
    Float:hIntPosX,
    Float:hIntPosY,
    Float:hIntPosZ
}
please help


Re: tag mismatch - SeanDenZYR - 29.04.2018

heres what it shows btw when i create the house, it saves properly and stuff but the text label won't work.




Re: tag mismatch - CantBeJohn - 29.04.2018

Simple fix:

PHP код:
enum hEnum {
    
hID,
    
hOwner[MAX_PLAYER_NAME],
    
Float:hPosX,
    
Float:hPosY,
    
Float:hPosZ,
    
hRentPrice,
    
hBuyable,
    
hPrice,
    
hRentable,
    
hTextLabel[500],
    
hVirtualWorld,
    
hInterior,
    
Float:hIntPosX,
    
Float:hIntPosY,
    
Float:hIntPosZ

Your hOwner variable was an integer rather than a string.


Re: tag mismatch - SeanDenZYR - 29.04.2018

it still gives me the warning, i've already realized that it was an integer instead of a string after posting that screenshot, i did the same by adding [MAX_PLAYER_NAME+1] to the "hOwner" variable. But i still get the error


Re: tag mismatch - CantBeJohn - 29.04.2018

Quote:
Originally Posted by SeanDenZYR
Посмотреть сообщение
it still gives me the warning, i've already realized that it was an integer instead of a string after posting that screenshot, i did the same by adding [MAX_PLAYER_NAME+1] to the "hOwner" variable. But i still get the error
PHP код:
enum hEnum {
    
hID,
    
hOwner[MAX_PLAYER_NAME],
    
Float:hPosX,
    
Float:hPosY,
    
Float:hPosZ,
    
hRentPrice,
    
hBuyable,
    
hPrice,
    
hRentable,
    
Text3D:hTextLabel[500],
    
hVirtualWorld,
    
hInterior,
    
Float:hIntPosX,
    
Float:hIntPosY,
    
Float:hIntPosZ

You forgot the "Text3D:" prefix for your text labels as well.


Re: tag mismatch - SeanDenZYR - 29.04.2018

oh, never knew there was a Text3D thing in samp, i thought it 3dTextLabels detects strings only, thanks for the info btw, rep given.


Re: tag mismatch - GaByM - 29.04.2018

PHP код:
enum hEnum {
    
Text3D:hTextLabel[500],
}
HouseInfo[id][hTextLabel] = HouseInfo[id][hTextLabel] = CreateDynamic3DTextLabel(hString, -1HouseInfo[id][hPosX], HouseInfo[id][hPosY], HouseInfo[id][hPosZ], 10.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0HouseInfo[id][hVirtualWorld], HouseInfo[id][hInterior], -1100.0); 
Why is hTextLabel an array with size 500? You use it to store the id returned by CreateDynamic3DTextLabel (which is an integer)

And why do you assign the same value twice?
PHP код:
HouseInfo[id][hTextLabel] = HouseInfo[id][hTextLabel] = CreateDynamic3DTextLabel(..)