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



Argument type mismatch. - thimo - 06.07.2013

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?


Re: Argument type mismatch. - Konstantinos - 06.07.2013

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)