Invalid function or declaration
#1

I get this error when compiling my script.
Код:
C:\Users\harvey\Documents\Server test\gamemodes\X.pwn(294) : warning 217: loose indentation
C:\Users\harvey\Documents\Server test\gamemodes\X.pwn(296) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
This is the callback that has an error in it:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 999)//dialog id response
				{
				    if(response)
				    	{
			    	if(listitem == 0)//the listitem0, defines the number one option of the dialog
				        {
				        if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
							{
							SendClientMessage(playerid, COLOR_WHITE, "You chose the Ballas as your class.");
				            ShowPlayerDialog(playerid, 998, DIALOG_STYLE_MSGBOX, "{6EF83C}Ballas Objective:", "{F81414}Fuck them Grove mothafuckas up!", "A'ight","");
				            gPlayerClass[playerid] = Ballas;
				            PickedClass[playerid] = 1;
				            SetPlayerVirtualWorld(playerid, 0);
							TogglePlayerControllable(playerid, 1);
							ResetPlayerWeapons(playerid);
							GivePlayerWeapon(playerid, 24, 70);//deagle
							}
						}

					if(listitem == 1)//the listitem1, defines the number one option of the dialog
				        {
	    					SendClientMessage(playerid, COLOR_WHITE, "You chose Grove as your class.");
				            ShowPlayerDialog(playerid, 998, DIALOG_STYLE_MSGBOX, "{6EF83C}Grove Objective:", "{F81414}Fuck them Ballas pussies up!", "A'ight","");
				            gPlayerClass[playerid] = Grove;
				            PickedClass[playerid] = 1;
				            RemovePlayerMapIcon(playerid, 0);
				            SetPlayerVirtualWorld(playerid, 0);
							TogglePlayerControllable(playerid, 1);
							ResetPlayerWeapons(playerid);
							GivePlayerWeapon(playerid, 24, 70);//deagle
		  				}
					}
	    			return 1;
			}

return 1;
}
return true;
}
Reply
#2

There should be 1 "return 1;" and 1 "return 0;". You should fix your indentations!

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 999)//dialog id response
                
{
                    if(
response)
                        {
                    if(
listitem == 0)//the listitem0, defines the number one option of the dialog
                        
{
                        if(
GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                            
{
                            
SendClientMessage(playeridCOLOR_WHITE"You chose the Ballas as your class.");
                            
ShowPlayerDialog(playerid998DIALOG_STYLE_MSGBOX"{6EF83C}Ballas Objective:""{F81414}Fuck them Grove mothafuckas up!""A'ight","");
                            
gPlayerClass[playerid] = Ballas;
                            
PickedClass[playerid] = 1;
                            
SetPlayerVirtualWorld(playerid0);
                            
TogglePlayerControllable(playerid1);
                            
ResetPlayerWeapons(playerid);
                            
GivePlayerWeapon(playerid2470);//deagle
                            
}
                        }
                    if(
listitem == 1)//the listitem1, defines the number one option of the dialog
                        
{
                            
SendClientMessage(playeridCOLOR_WHITE"You chose Grove as your class.");
                            
ShowPlayerDialog(playerid998DIALOG_STYLE_MSGBOX"{6EF83C}Grove Objective:""{F81414}Fuck them Ballas pussies up!""A'ight","");
                            
gPlayerClass[playerid] = Grove;
                            
PickedClass[playerid] = 1;
                            
RemovePlayerMapIcon(playerid0);
                            
SetPlayerVirtualWorld(playerid0);
                            
TogglePlayerControllable(playerid1);
                            
ResetPlayerWeapons(playerid);
                            
GivePlayerWeapon(playerid2470);//deagle
                          
}
              return 
1;
        }
      return 
0;

Reply
#3

Quote:
Originally Posted by AjaxM
Посмотреть сообщение
There should be 1 "return 1;" and 1 "return 0;". You should fix your indentations!

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 999)//dialog id response
                
{
                    if(
response)
                        {
                    if(
listitem == 0)//the listitem0, defines the number one option of the dialog
                        
{
                        if(
GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                            
{
                            
SendClientMessage(playeridCOLOR_WHITE"You chose the Ballas as your class.");
                            
ShowPlayerDialog(playerid998DIALOG_STYLE_MSGBOX"{6EF83C}Ballas Objective:""{F81414}Fuck them Grove mothafuckas up!""A'ight","");
                            
gPlayerClass[playerid] = Ballas;
                            
PickedClass[playerid] = 1;
                            
SetPlayerVirtualWorld(playerid0);
                            
TogglePlayerControllable(playerid1);
                            
ResetPlayerWeapons(playerid);
                            
GivePlayerWeapon(playerid2470);//deagle
                            
}
                        }
                    if(
listitem == 1)//the listitem1, defines the number one option of the dialog
                        
{
                            
SendClientMessage(playeridCOLOR_WHITE"You chose Grove as your class.");
                            
ShowPlayerDialog(playerid998DIALOG_STYLE_MSGBOX"{6EF83C}Grove Objective:""{F81414}Fuck them Ballas pussies up!""A'ight","");
                            
gPlayerClass[playerid] = Grove;
                            
PickedClass[playerid] = 1;
                            
RemovePlayerMapIcon(playerid0);
                            
SetPlayerVirtualWorld(playerid0);
                            
TogglePlayerControllable(playerid1);
                            
ResetPlayerWeapons(playerid);
                            
GivePlayerWeapon(playerid2470);//deagle
                          
}
              return 
1;
        }
      return 
0;

I get couple of errors when I use that code you sent, Instead I used this one
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 999)//dialog id response
				{
				    if(response)
				    	{
			    	if(listitem == 0)//the listitem0, defines the number one option of the dialog
				        {
				        if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
							{
							SendClientMessage(playerid, COLOR_WHITE, "You chose the Ballas as your class.");
				            ShowPlayerDialog(playerid, 998, DIALOG_STYLE_MSGBOX, "{6EF83C}Ballas Objective:", "{F81414}Fuck them Grove mothafuckas up!", "A'ight","");
				            gPlayerClass[playerid] = Ballas;
				            PickedClass[playerid] = 1;
				            SetPlayerVirtualWorld(playerid, 0);
							TogglePlayerControllable(playerid, 1);
							ResetPlayerWeapons(playerid);
							GivePlayerWeapon(playerid, 24, 70);//deagle
							}
						}

					if(listitem == 1)//the listitem1, defines the number one option of the dialog
				        {
	    					SendClientMessage(playerid, COLOR_WHITE, "You chose Grove as your class.");
				            ShowPlayerDialog(playerid, 998, DIALOG_STYLE_MSGBOX, "{6EF83C}Grove Objective:", "{F81414}Fuck them Ballas pussies up!", "A'ight","");
				            gPlayerClass[playerid] = Grove;
				            PickedClass[playerid] = 1;
				            RemovePlayerMapIcon(playerid, 0);
				            SetPlayerVirtualWorld(playerid, 0);
							TogglePlayerControllable(playerid, 1);
							ResetPlayerWeapons(playerid);
							GivePlayerWeapon(playerid, 24, 70);//deagle
		  				}
					}
	    			return 1;
			}
	return 0;
}
It doesnt show any errors anymore, anyways thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)