arrgument 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: arrgument type mismatch (argument 2) (
/showthread.php?tid=485480)
arrgument type mismatch (argument 2) -
Mey6155 - 04.01.2014
I'm getting this error ^, here:
pawn Код:
case DIALOG_CHOOSETEAM:
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_CHOOSETEAM, DIALOG_STYLE_LIST, ""COL_GREEN"TEAMS", ""COL_LIGHTBLUE"Marine Raiders(Known as America)\n"COL_RED"Red Army(Known as Sovjet Unie)", "Choose", "");
if(response)
{
if(listitem == 0)
{
gTeam[playerid] = TEAM_MARINERAIDERS;
SetPlayerColor(playerid, TEAM_MARINERAIDERS_COLOUR); // AND HERE
SpawnPlayer(playerid);
}
if(listitem == 1)
{
gTeam[playerid] = TEAM_REDARMY;
SetPlayerColor(playerid, TEAM_REDARMY_COLOUR); // OVER HERE
SpawnPlayer(playerid);
}
return 1;
}
}
}
return 1;
}
Re: arrgument type mismatch (argument 2) -
PrivatioBoni - 04.01.2014
You're adding an excess argument:
Correct usage:
pawn Код:
SetPlayerColor(playerid, 0xFFFF00AA);
So, do it like "If [something something] - and then SetPlayerColor using the above example.
ED: Misread your code, change your COLOR names to something else, possibly a COLOR without two underscores. Not sure.
ED again: Oh yes. It needs to be an integer or hex. So, do what the person suggested in post #4.
Re: arrgument type mismatch (argument 2) -
Jessyy - 04.01.2014
show how you defined 'TEAM_MARINERAIDERS_COLOUR' and 'TEAM_REDARMY_COLOUR'
Re: arrgument type mismatch (argument 2) -
Mey6155 - 04.01.2014
#define TEAM_MARINERAIDERS_COLOUR "{00CED1}"
#define TEAM_REDARMY_COLOUR "{F81414}"
Re: arrgument type mismatch (argument 2) -
Seif- - 04.01.2014
Are you using those macros to send client messages with those colors? If so, I recommend making new ones like this:
pawn Код:
#define MARINERAIDERS_COLOUR 0x00CED1FF
#define REDARMY_COLOUR 0xF81414FF
then use those for SetPlayerColor.
Re: arrgument type mismatch (argument 2) -
Mey6155 - 04.01.2014
Thanks Seif-, +REP