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

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

Use format: https://sampwiki.blast.hk/wiki/Format
Reply
#3

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

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

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

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

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

Post that line please.
Reply
#8

Код:
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
Reply
#9

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!
Reply
#10

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]); 
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)