Argument type mismatch - 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: Argument type mismatch (
/showthread.php?tid=435406)
Argument type mismatch -
Andriensis - 06.05.2013
format(str,128,"[%d] %s ha reportato %s [%d]. Motivo: '%s'",report1reportante,GetPlayerNameEx(report1rep ortante),GetPlayerNameEx(report1reportato),report1 reportato,report1desc);
error 035: argument type mismatch (argument 1)
What's the problem?
Re: Argument type mismatch -
Jochemd - 06.05.2013
The third argument should be the size of the string.
Re: Argument type mismatch -
Andriensis - 06.05.2013
Quote:
Originally Posted by Jochemd
The third argument should be the size of the string.
|
The second one is the size, isn't it?
Re: Argument type mismatch -
MP2 - 06.05.2013
Show the declaration ('new') for 'str'. You should also use sizeof() so if you change the string's array size, you won't have to change it in format() also. Also, SendClientMessage is limited to 144 characters, not 128. 128 is chat input. A lot of people don't know this.
EDIT: The problem looks like it's with GetPlayerNameEx.
Re: Argument type mismatch -
Jochemd - 06.05.2013
Look your first GetPlayerNameEx. Not sure if you got it also in the script like that but that may be causing it?
Re: Argument type mismatch -
Andriensis - 06.05.2013
Quote:
Originally Posted by MP2
Show the declaration ('new') for 'str'. You should also use sizeof() so if you change the string's array size, you won't have to change it in format() also. Also, SendClientMessage is limited to 144 characters, not 128. 128 is chat input. A lot of people don't know this.
|
new str[256];
Quote:
Originally Posted by Jochemd
Look your first GetPlayerNameEx. Not sure if you got it also in the script like that but that may be causing it?
|
well, it's right I believe, this is not the first time I use it and it has always worked.
"player1reportato" is an ID.