warning 202: number of arguments does not match definition - 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: warning 202: number of arguments does not match definition (
/showthread.php?tid=523928)
warning 202: number of arguments does not match definition -
Team_PRO - 04.07.2014
pawn Код:
C:\Users\Matt\Desktop\truckingph\gamemodes\truckingph.pwn(2058) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
PHP код:
SendClientMessage(playerid,-1, "Admininstrator %s(ID:%d) has cleared the chat!",GetPName(playerid));
Re: warning 202: number of arguments does not match definition -
iOxide - 04.07.2014
In this case, you must format your message before sending, since the message has player name.
You cannot directly insert a var into SendClientMessage function.
pawn Код:
new str[128];
format(str, sizeof(str), "Admininstrator %s(ID:%d) has cleared the chat!",GetPName(playerid), playerid);
SendClientMessageToAll(-1,str); //I saw you are making a clear chat command so i changed the SendClientMessage to SendClientMessageToAll because using SendClientMessage returns the formatted message to the person who used the command
Re: warning 202: number of arguments does not match definition -
DarkZeroX - 04.07.2014
Else
PHP код:
stock SendClientFormattedMessage(playerid, couleur, const message[], {Float,_}:...)
{
static const
ARGUMENTS = 3;
new
n = (numargs() - ARGUMENTS) * BYTES_PER_CELL;
if (!n) return SendClientMessage(playerid, couleur, message);
new
fstring[145],
arg_start,
arg_end;
#emit CONST.alt message
#emit LCTRL 5
#emit ADD
#emit STOR.S.pri arg_start
#emit LOAD.S.alt n
#emit ADD
#emit STOR.S.pri arg_end
do
{
#emit LOAD.I
#emit PUSH.pri
arg_end -= BYTES_PER_CELL;
#emit LOAD.S.pri arg_end
}
while (arg_end > arg_start);
#emit PUSH.S message
#emit PUSH.C 145
#emit PUSH.ADR fstring
n += BYTES_PER_CELL * 3;
#emit PUSH.S n
#emit SYSREQ.C format
n += BYTES_PER_CELL;
#emit LCTRL 4
#emit LOAD.S.alt n
#emit ADD
#emit SCTRL 4
return SendClientMessage(playerid, couleur, fstring);
}
Thank Sartek Le Bifsteak
SendClientFormattedMessage(playerid,-1, "Admininstrator %s(ID:%d) has cleared the chat!",GetPName(playerid));
Re : warning 202: number of arguments does not match definition -
S4t3K - 04.07.2014
@DZX : Giving him the function as it is is not the best way to make him understanding anything of it.
@Author : Use y_va for this kind of functions. (directly using specifiers in a string without using format before).