tag mismatch
#1

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
Reply
#2

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

Reply
#3

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.
Reply
#4

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
Reply
#5

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.
Reply
#6

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

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(..) 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)