error 035: argument type mismatch (argument 3)
#1

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);
Reply
#2

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
Reply
#3

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.
Reply
#4

Thanks for the replies guys, it helped!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)