warning 202: number of arguments does not match definition
#1

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

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
Reply
#3

Else

PHP код:

stock SendClientFormattedMessage
(playeridcouleur, const message[], {Float,_}:...) 

    static const 
    
ARGUMENTS 3
    new 
    
= (numargs() - ARGUMENTS) * BYTES_PER_CELL
    if (!
n) return SendClientMessage(playeridcouleurmessage); 
    
    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 
    
    
+= BYTES_PER_CELL 3
    
#emit PUSH.S          n 
    #emit SYSREQ.C         format 
    
    
+= BYTES_PER_CELL
    
#emit LCTRL          4 
    #emit LOAD.S.alt        n 
    #emit ADD 
    #emit SCTRL          4 
    
    
return SendClientMessage(playeridcouleurfstring); 
}  
Thank Sartek Le Bifsteak
SendClientFormattedMessage
(playerid,-1"Admininstrator %s(ID:%d) has cleared the chat!",GetPName(playerid)); 
Reply
#4

@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).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)