Number of arguments are not correct
#1

Error
PHP код:
warning 202number of arguments does not match definition 
Called function
PHP код:
new targettext[500];
    if (
sscanf(params"us[200]"targettext))
    {
        if(!
IsPlayerConnected(target)) return SendClientMessage(playerid, -1"No connected");
        
createReport(NoReports,text,returnNameEx(playerid),returnNameEx(target)); //error
        
SendClientMessage(playerid,-1,"Report has been send to online admins");
    }
    else
    {
        
SendClientMessage(playerid, -1"/report ID reason");
        return 
1;
    } 
Function
PHP код:
forward createReport(r_Id,r_Text[],r_Name[MAX_PLAYER_NAME+1],r_For[MAX_PLAYER_NAME+1]);
public 
createReport(r_Id,r_Text[],r_Name[MAX_PLAYER_NAME+1],r_For[MAX_PLAYER_NAME+1])
{
  new 
HourMinute,SecondYearMonthDay;
  
getdate(YearMonthDay);
  
gettime(HourMinuteSecond);
  
ReportInfo[r_Id][rDate][0] = Year;
  
ReportInfo[r_Id][rDate][1] = Month;
  
ReportInfo[r_Id][rDate][2] = Day;
  
ReportInfo[r_Id][rTime][0] = Minute;
  
ReportInfo[r_Id][rTime][1] = Hour;
  
ReportInfo[r_Id][rStatus] = 1;
  
ReportInfo[r_Id][rId] = r_Id;
  
format(ReportInfo[r_Id][rText],200,r_Text);
  
format(ReportInfo[r_Id][rName],MAX_PLAYER_NAME+1,r_Name);
  
format(ReportInfo[r_Id][rFor],MAX_PLAYER_NAME+1,r_For);
  
NoReports++;
  if(
NoReports == 10)
  {
    
NoReports 0;
  }
  return 
1;

Reply
#2

I compilered it myself and there are no errors.
for first, make sure your compiler is working good, than try to change arguments from createReport(NoReports,text,returnNameEx(playerid) ,returnNameEx(target)); one-by-one to trace your problem.
for example
from: createReport(NoReports,text,returnNameEx(playerid) ,returnNameEx(target));
to: createReport(NoReports,text,returnNameEx(playerid) ,"test");
Reply
#3

Now error
Quote:

error 047: array sizes do not match, or destination array is too small in the createReport(NoReports,text,returnNameEx(playerid) ,returnNameEx(target));

Reply
#4

Problem solved
should be like this

forward createReport(r_Id,r_Text[],r_Name[],r_For[]);
public createReport(r_Id,r_Text[],r_Name[],r_For[])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)