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



error 035: argument type mismatch (argument 2) - Filbert - 22.05.2020

PHP Code:
if(InDM[playerid] == && PlayerInfo[playerid][Color] == 1) {
        new 
colorhex[128];
        switch(
PlayerInfo[playerid][pColor]) {
            case 
1colorhex "0xFF0000AA";
            case 
2colorhex "0x00FFFFAA";
            case 
3colorhex "0xFFFF00AA";
            case 
4colorhex "0x33FF33AA";
            case 
5colorhex "0xFF00FFC8";
            case 
6colorhex "0x2C2727AA";
            case 
7colorhex "0xFFFFFFAA";
        }
        switch(
PlayerInfo[playerid][team]) {
            case 
TEAM_WORKERSetPlayerColor(playerid,colorhex);//<<<Line 21729
            
case TEAM_blablaSetPlayerColor(playerid,colorhex);//<<<Line 21730
            
...
        }

Code:
(21729) : error 035: argument type mismatch (argument 2)
(21730) : error 035: argument type mismatch (argument 2)
...
How to fix this?


Re: error 035: argument type mismatch (argument 2) - StevenLV - 22.05.2020

If you search on the wiki for SetPlayerColor:
Quote:

Description:
Set the colour of a player's nametag and marker (radar blip).
Parameters:
(playerid, color)
playerid The ID of the player whose color to set.
color The color to set. Supports alpha values.

It is not a string. Hexadecimal is a number. So use a define maybe or use it as int however you want to.

An advice: When every you egt type mismatch etc so please search for native function to get a clear idea.