Function call problem
#1

Error
PHP код:
error 012invalid function callnot a valid address 
Code on error
PHP код:
Dialog:DIALOG_REPORT(playeridresponselistiteminputtext[])
{
  if(!
response) return 1;
  if(
response)
  {
    
readingReport(playerid,listitem); //error
  
}
  return 
1;

Function area
PHP код:
forward readingReport(playerid,id);
public 
readingReport(playerid,id)
{
    new 
str3[1024], Status[150];
  if(
ReportInfo[id][rStatus] == 1Status "{F20000}Untreated";
  if(
ReportInfo[id][rStatus] == 2Status "{F2B100}Processed by";
  if(
ReportInfo[id][rStatus] == 3Status "{00CE00}Being processed";
  if(
ReportInfo[id][rStatus] == 2)
  {
    
format(str31024"\n\t%s %s\n{FEFEFE}Name: %s\nAccused: %s\nDate: %d/%d/%d\nTime: %d:%d\nReason: %s",
    
Status,ReportInfo[id][rNameprocessed],ReportInfo[id][rName],ReportInfo[id][rFor],
    
ReportInfo[id][rDate][2],ReportInfo[id][rDate][1],ReportInfo[id][rDate][0],
    
ReportInfo[id][rTime][1],ReportInfo[id][rTime][0],ReportInfo[id][rText]);
  }
  else
  {
    
format(str31024"\n\t%s\n{FEFEFE}Name: %s\nnAccused: %s\nDate: %d/%d/%d\nTime: %d:%d\nReason: %s",
    
Status,ReportInfo[id][rName],ReportInfo[id][rFor],
    
ReportInfo[id][rDate][2],ReportInfo[id][rDate][1],ReportInfo[id][rDate][0],
    
ReportInfo[id][rTime][1],ReportInfo[id][rTime][0],ReportInfo[id][rText]);
  }
  
Dialog_Show(playerid,DIALOG_REPORT1,DIALOG_STYLE_MSGBOX,"Reading the report",str3,"Edit","Retour");
  
readingReport[playerid] = id;
  return 
1;

Reply
#2

This doesn't make any sense anyway, that string you're formatting is declared within the function and not used anywhere inside the function = useless.
Reply
#3

Sorry i didn't update full
Reply
#4

Anyone know what's the issue
Reply
#5

Don't you have a variable called readingReport or anything called like that?
Reply
#6

Yes....
Reply
#7

Quote:
Originally Posted by Jokers98s
Посмотреть сообщение
Yes....
You can't have a variable and a function with the same name. That's why you get this error while compiling
Reply
#8

Thanks its fixed . +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)