SA-MP Forums Archive
Error "ondialogresponse" in "case" with the statement "if" - 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: Error "ondialogresponse" in "case" with the statement "if" (/showthread.php?tid=431369)



Error "ondialogresponse" in "case" with the statement "if" - Daledos - 17.04.2013

I can not understand because it gives me these errors:

Код:
error 012: invalid function call, not a valid address
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
fatal error 107: too many error messages on one line
The code:

Код:
 		else if(dialogid == 9999) // SISTEMA POSTALE
		{
        switch(listitem)
	      {
          case 0:
		      {
                  if(StipendioGelataio(playerid) == 1)   // ERRORS IN THIS STRING
				  {
				  SendClientMessage(playerid, COLOR_YELLOW, "[POSTE:] Devi aspettare il PayDay per poter ritirare il tuo stipendio!");
				  return 1;
				  }
				  else if(StipendioGelataio(playerid) == 2)
				  {
				  GivePlayerMoney(playerid, 1600);
				  SendClientMessage(playerid, COLOR_YELLOW, "[POSTE:] Hai ritirato il tuo stipendio, che equivale a 1600$");
				  StipendioGelataio(playerid) = 0;
				  return 1;
				  }
				  else
				  {
				  SendClientMessage(playerid, COLOR_YELLOW, "[POSTE:] Non hai lavorato, quindi non hai uno stipendio da poter ritirare!");
				  return 1;
				  }
			  }
          }
	    }
Thank!


Re: Error "ondialogresponse" in "case" with the statement "if" - TomatoRage - 17.04.2013

Must remove else from else if and you put it in case make before switch

Edited


Re: Error "ondialogresponse" in "case" with the statement "if" - Daledos - 17.04.2013

Quote:
Originally Posted by TomatoRage
Посмотреть сообщение
Must remove else from else if and you put it in case make before switch

Edited
I have already tried, the same mistakes ...


Re: Error "ondialogresponse" in "case" with the statement "if" - SilverKiller - 17.04.2013

Did you define StipendioGelataio?


Re: Error "ondialogresponse" in "case" with the statement "if" - Daledos - 17.04.2013

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
Did you define StipendioGelataio?
Yes! Up the gamemode:

Код:
new StipendioGelataio[MAX_PLAYERS] = 0;



Re: Error "ondialogresponse" in "case" with the statement "if" - Revo - 17.04.2013

Try replacing the () with []
pawn Код:
if(StipendioGelataio[playerid] == 1)



Re: Error "ondialogresponse" in "case" with the statement "if" - Daledos - 17.04.2013

Quote:
Originally Posted by Revo
Посмотреть сообщение
Try replacing the () with []
pawn Код:
if(StipendioGelataio[playerid] == 1)
It works! Thanks to all!