Create3DTextLabel argument type mismatch
#1

Hi. I'm trying to load 3d text labels from my database, but it keeps coming with an argument type mismatch.
pawn Код:
TextLabelInfo[i][tlObject] = Create3DTextLabel(TextLabelInfo[i][tlText], TextLabelInfo[i][tlColor], TextLabelInfo[i][tlPosX], TextLabelInfo[i][tlPosY], TextLabelInfo[i][tlPosZ], 40.0, 0, 0);
Usually when I have problems like this, it's something that everyone can see, but apparently my eye can't find it!

pawn Код:
LoadTextLabels(playerid)
{
    for(new i = 0; i != MAX_TEXTLABELS; i++)
    {
        if(TextLabelInfo[i][tlCreated] == 0)
        {
            new query[300];
            new savingstring[20];
            mysql_query("SELECT * FROM 3dtexts");
            mysql_store_result();
            while(mysql_fetch_row_format(query, "|"))
            {
                mysql_fetch_field_row(savingstring, "id"); TextLabelInfo[i][tlID] = strval(savingstring);
                mysql_fetch_field_row(savingstring, "text"); TextLabelInfo[i][tlText] = strval(savingstring);
                mysql_fetch_field_row(savingstring, "color"); TextLabelInfo[i][tlColor] = strval(savingstring);
                mysql_fetch_field_row(savingstring, "posx"); TextLabelInfo[i][tlPosX] = strval(savingstring);
                mysql_fetch_field_row(savingstring, "posy"); TextLabelInfo[i][tlPosY] = strval(savingstring);
                mysql_fetch_field_row(savingstring, "posz"); TextLabelInfo[i][tlPosZ] = strval(savingstring);
            }
            TextLabelInfo[i][tlObject] = Create3DTextLabel(TextLabelInfo[tlText], TextLabelInfo[tlColor], TextLabelInfo[tlPosX], TextLabelInfo[tlPosY], TextLabelInfo[tlPosZ], 40.0, 0, 0);
        }
    }
}
Reply
#2

Text is a string and the position are floats. Strval is for numbers only.

Also consider upgrading to threaded queries.
Reply
#3

Okay. Thanks.

Edit: It would be pretty pointless for me to convert right now. What should I use instead of strval?
Reply
#4

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)