Argument type mismatch.
#1

Okay im selecting fields from a database and using Floats. This is the code:
pawn Код:
mysql_get_field("Model", cModel);
                    mysql_get_field("X", cx);
                    mysql_get_field("Y", cy);
                    mysql_get_field("Z", cz);
                    mysql_get_field("Rot", crot);
                    mysql_get_field("Color1", Col1);
                    mysql_get_field("Color2", Col2);
And here are the new:
pawn Код:
new cModel, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2;
The errors:
Код:
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5088) : error 035: argument type mismatch (argument 1)
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5089) : error 035: argument type mismatch (argument 1)
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5090) : error 035: argument type mismatch (argument 1)
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5091) : error 035: argument type mismatch (argument 1)
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5092) : error 035: argument type mismatch (argument 1)
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5093) : error 035: argument type mismatch (argument 1)
C:\Users\Thimo\SkyDrive\GTA sa-mp\Sa-mp 0.3d\gamemodes\ET.pwn(5094) : error 035: argument type mismatch (argument 1)
But probably because im using Floats it gives me these errors but how to fix them?
Reply
#2

Take a look at the second parameter.
pawn Код:
mysql_get_field( const fieldname[ ], string[ ] );
Store the result to a string and then use strval and floatstr functions.

However, I'd suggest you use cache_get_row_int and cache_get_row_float because they're a bit faster than converting. (R7+ only)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)