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



error 035: argument type mismatch (argument 3) - cipi89 - 02.02.2020

I ran into this issue just now and instead of making the script differently I'd first like to know why exactly doesn't this work?

Example code:
Code:
new col_str[24], pgpg[10];
format(pgpg, 10, "FF0000");
format(col_str, 24, "0x%sCC", pgpg);
GangZoneFlashForPlayer(playerid, gangwars_Zone, col_str);
Error is at this line:
Code:
GangZoneFlashForPlayer(playerid, gangwars_Zone, col_str);



Re: error 035: argument type mismatch (argument 3) - ApolloScripter - 02.02.2020

Hello cipi89 why are you formatting the hex-dec color code?, as it says on the Wiki, it must to be a integer or hex in RGBA, the way you are using, makes the parameter a String, so it gives the error. Just remove the format stuff and put on top of your GameMode:

pawn Code:
#define ColorName FF000080
So you just need to use:

pawn Code:
GangZoneFlashForPlayer(playerid, gangwars_Zone, ColorName);
The last two digits (80) is for the Alpha channel transparency of the GangZone.
For more information: https://sampwiki.blast.hk/wiki/GangZoneFlashForPlayer


Re: error 035: argument type mismatch (argument 3) - Calisthenics - 03.02.2020

Apollo explained the error. Converting string to hex can be done with sscanf
pawn Code:
new hex_color;
format(col_str, 24, "0x%sCC", pgpg);
sscanf(col_str, "x", hex_color);
Use `hex_color` in `GangZoneFlashForPlayer` function.


Re: error 035: argument type mismatch (argument 3) - cipi89 - 04.02.2020

Thanks for the replies guys, it helped!