SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/02/2020, 09:15 PM   #1
cipi89
Little Clucker
 
Join Date: Sep 2018
Posts: 30
Reputation: 3
Default error 035: argument type mismatch (argument 3)

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);
cipi89 is offline   Reply With Quote
Old 02/02/2020, 10:15 PM   #2
ApolloScripter
Huge Clucker
 
ApolloScripter's Avatar
 
Join Date: Sep 2018
Posts: 231
Reputation: 7
Default Re: error 035: argument type mismatch (argument 3)

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://wiki.sa-mp.com/wiki/GangZoneFlashForPlayer
__________________
ApolloScripter is offline   Reply With Quote
Old 03/02/2020, 03:01 PM   #3
Calisthenics
High-roller
 
Join Date: May 2018
Posts: 1,228
Reputation: 205
Default Re: error 035: argument type mismatch (argument 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.
__________________
Calisthenics is offline   Reply With Quote
Old 04/02/2020, 01:23 AM   #4
cipi89
Little Clucker
 
Join Date: Sep 2018
Posts: 30
Reputation: 3
Default Re: error 035: argument type mismatch (argument 3)

Thanks for the replies guys, it helped!
cipi89 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error 035: argument type mismatch (argument 1)/(argument 2) DavidGravelli Scripting Help 3 08/03/2019 11:42 AM
Assistance Needed | error 035: argument type mismatch (argument 2) KevTheJoker Scripting Help 4 14/01/2019 09:29 PM
D:\server\gamemodes\ExtremeGame.pwn(22326) : error 035: argument type mismatch (argument 2) enzulikeS Scripting Help 2 25/04/2018 03:38 PM
C:\Users\Lirbo\Desktop\Roleplay\gamemodes\ERP.pwn( 19) : error 035: argument type mismatch (argument 1) Lirbo Scripting Help 2 12/12/2014 02:51 PM
error 035: argument type mismatch (argument 2) [Using MySQL R7/R8 With Cache] viveka27 Scripting Help 1 21/05/2013 03:31 PM


All times are GMT. The time now is 12:38 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.