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=575164)



error 035: argument type mismatch (argument 3) - SandKing94 - 24.05.2015

Code:
Код:
strcat(string2, "Faction - Name:%s | Rank:%s | Division:%s\n",PFactionName[playerib],PFactionRank[playerib],PFactionDivision[playerib]);
Error:
Код:
error 035: argument type mismatch (argument 3)



Re: error 035: argument type mismatch (argument 3) - Konstantinos - 24.05.2015

Use format: https://sampwiki.blast.hk/wiki/Format


Re: error 035: argument type mismatch (argument 3) - SandKing94 - 24.05.2015

But the problem is that i get error for too long line when i use format, because i have over 20 things that i want to put in, this is why i use strcat...


Re: error 035: argument type mismatch (argument 3) - Konstantinos - 24.05.2015

strcat is only used to join another string (formatted before as it doesn't accept arguments like format function).

You can split the arguments as long as you want (the string would be with \ character but no need to.
pawn Код:
format(string2, sizeof (string2), "Faction - Name:%s | Rank:%s | Division:%s\n",
PFactionName[playerib],
PFactionRank[playerib],
PFactionDivision[playerib]);



Re: error 035: argument type mismatch (argument 3) - FplayerGR - 24.05.2015

use this
Код:
new a[256],b[256];
format(a,sizeof(a),"a");
format(b,sizeof(b),"b");
strcat(string2,"%s %s..etc",a,b... etc);
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
strcat is only used to join another string (formatted before as it doesn't accept arguments like format function).

You can split the arguments as long as you want (the string would be with \ character but no need to.
pawn Код:
format(string2, sizeof (string2), "Faction - Name:%s | Rank:%s | Division:%s\n",
PFactionName[playerib],
PFactionRank[playerib],
PFactionDivision[playerib]);
yes and this is very very good.


Re: error 035: argument type mismatch (argument 3) - SandKing94 - 24.05.2015

I get error for too long line even if i split the arguments.....
@FplayerrGR i cant understand that...


Re: error 035: argument type mismatch (argument 3) - Konstantinos - 24.05.2015

If the text is too long, then yes - use strcat as \ character sometimes doesn't fix the error.

Post that line please.


Re: error 035: argument type mismatch (argument 3) - SandKing94 - 24.05.2015

Код:
strcat(string2, "Account - Player level:%d | Playing hours:%d | Playing minutes:%d | Checks signed:%d | Administrator level:%d | Helper level:%d | Donator level:%d\n",pInfo[playerib][Level],pInfo[playerib][Hours],pInfo[playerib][Minutes],pInfo[playerib][Checks],pInfo[playerib][Admin],pInfo[playerib][Helper],pInfo[playerib][Donator]);
	        strcat(string2, "Inventory - Money:%d | Bank:%d | Sandwiches:%d | Hotdogs:%d | Apples:%d | Sodas:%d\n",pInfo[playerib][Money],pInfo[playerib][Bank],pInfo[playerib][Sandwiches],pInfo[playerib][Hotdogs],pInfo[playerib][Apples],pInfo[playerib][Sodas]);
	        //strcat(string2, "Faction - Name:%s | Rank:%s | Division:%s\n",PFactionName[playerib],PFactionRank[playerib],PFactionDivision[playerib]);
	        strcat(string2, "Admin record - Prisons:%d | Warnings:%d | Kicks:%d | Temp. bans:%d | Perm. bans:%d",pInfo[playerib][Prisons],pInfo[playerib][Warnings],pInfo[playerib][Kicks],pInfo[playerib][TempBans],pInfo[playerib][PermBans]);
The line with comment // is the one that gives error


Re: error 035: argument type mismatch (argument 3) - FplayerGR - 24.05.2015

hm... ok again

Код:
new a[256];//your new variable for formated
new b[256];//your new variable for formated
format(a,sizeof(a),"your faction stats",your variables);
format(b,sizeof(b),"your faction stats",your variables);
strcat(string1/2,"%s=a %s = b",a,b);
else use in your script '\' for new lines. Posted by:Konstantinos!


Re: error 035: argument type mismatch (argument 3) - Konstantinos - 24.05.2015

PHP код:
new string2[512]; // if the text is cut out, increase it.
format(string2sizeof (string2), "Account - Player level:%d | Playing hours:%d | Playing minutes:%d | Checks signed:%d | Administrator level:%d | Helper level:%d | Donator level:%d\n" \
"Inventory - Money:%d | Bank:%d | Sandwiches:%d | Hotdogs:%d | Apples:%d | Sodas:%d\n" \
"Faction - Name:%s | Rank:%s | Division:%s\n" \
"Admin record - Prisons:%d | Warnings:%d | Kicks:%d | Temp. bans:%d | Perm. bans:%d",
pInfo[playerib][Level],pInfo[playerib][Hours],pInfo[playerib][Minutes],pInfo[playerib][Checks],pInfo[playerib][Admin],pInfo[playerib][Helper],pInfo[playerib][Donator],
pInfo[playerib][Money],pInfo[playerib][Bank],pInfo[playerib][Sandwiches],pInfo[playerib][Hotdogs],pInfo[playerib][Apples],pInfo[playerib][Sodas]
PFactionName[playerib],PFactionRank[playerib],PFactionDivision[playerib],
pInfo[playerib][Prisons],pInfo[playerib][Warnings],pInfo[playerib][Kicks],pInfo[playerib][TempBans],pInfo[playerib][PermBans]);