SA-MP Forums Archive
Create3DTextLabel argument type 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: Create3DTextLabel argument type mismatch (/showthread.php?tid=442184)



Create3DTextLabel argument type mismatch - reckst4r - 06.06.2013

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



Re: Create3DTextLabel argument type mismatch - Vince - 06.06.2013

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

Also consider upgrading to threaded queries.


Re: Create3DTextLabel argument type mismatch - reckst4r - 06.06.2013

Okay. Thanks.

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


Re: Create3DTextLabel argument type mismatch - reckst4r - 06.06.2013

Bump