Error pls help me
#1

Guys this is my script: http://pastebin.com/gGLFprw7


This is the error:
PHP код:
error 030compound statement not closed at the end of file (started at line 94
PS: If you can I can do this problem you explain how you did it so I learn a little
Reply
#2

You didn't close the bracket after SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that."); (2 of them), did you?
Reply
#3

try this
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
listitem == 0)
    {
        if(
Materiali[playerid] > 399)
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a desert eagle.");
            
GivePlayerWeapon(playerid249999999);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
            return 
1;
        }
    }
    if(
listitem == 1)
    {
          if(
Materiali[playerid] > 149)
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a pump-action shotgun.");
            
GivePlayerWeapon(playerid259999999);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
            return 
1;
        }
    }
    if(
listitem == 2)
    {
        if(
Materiali[playerid] > 249)
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a MP5.");
            
GivePlayerWeapon(playerid299999999);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
            return 
1;
        }
    }
    if(
listitem == 3)
    {
        if(
Materiali[playerid] > 499)
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a M4 carbine.");
            
GivePlayerWeapon(playerid319999999);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
            return 
1;
        }
    }
    if(
listitem == 4)
    {
        if(
Materiali[playerid] > 549)
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a Spas-12.");
            
GivePlayerWeapon(playerid279999999);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
            return 
1;
        }
    }

Reply
#4

This 2 Error
PHP код:
warning 209: function "OnDialogResponse" should return a value 
PHP код:
warning 217loose indentation 
Reply
#5

try this

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) 
{ 
    if(listitem == 0) 
    { 
        if(Materiali[playerid] > 399) 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a desert eagle."); 
            GivePlayerWeapon(playerid, 24, 9999999); 
            return 1; 
        } 
        else 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that."); 
            return 1; 
        } 
    } 
    if(listitem == 1) 
    { 
        if(Materiali[playerid] > 149) 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a pump-action shotgun."); 
            GivePlayerWeapon(playerid, 25, 9999999); 
            return 1; 
        } 
        else 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that."); 
            return 1; 
        } 
    } 
    if(listitem == 2) 
    { 
        if(Materiali[playerid] > 249) 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a MP5."); 
            GivePlayerWeapon(playerid, 29, 9999999); 
            return 1; 
        } 
        else 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that."); 
            return 1; 
        } 
    } 
    if(listitem == 3) 
    { 
        if(Materiali[playerid] > 499) 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a M4 carbine."); 
            GivePlayerWeapon(playerid, 31, 9999999); 
            return 1; 
        } 
        else 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that."); 
            return 1; 
        } 
    } 
    if(listitem == 4) 
    { 
        if(Materiali[playerid] > 549) 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You have crafted yourself a Spas-12."); 
            GivePlayerWeapon(playerid, 27, 9999999); 
            return 1; 
        } 
        else 
        { 
            SendClientMessage(playerid, COLOUR_WHITE, "You dont have enough materials to make that."); 
            return 1; 
        } 
    }
    return 1; 
}
Reply
#6

Ty u so much
Reply
#7

Guys this command don't give any Material why?
PHP код:
CMD:Compramateriali(playeridparams[])
{
    
ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Materiali","500 Materiali (500$)\n700 Materiali (900$)\n 1000 Materiali (2000$)","Compra","Esci");
    return 
1;

Reply
#8

You must check the dialogid before and then its listitems otherwise will surely be bugged with other scripts.
Reply
#9

Quote:
Originally Posted by kevi11
Посмотреть сообщение
Guys this command don't give any Material why?
PHP код:
CMD:Compramateriali(playeridparams[])
{
    
ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Materiali","500 Materiali (500$)\n700 Materiali (900$)\n 1000 Materiali (2000$)","Compra","Esci");
    return 
1;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 7)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(
Materiali[playerid] > 399)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a desert eagle.");
                    
GivePlayerWeapon(playerid249999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 1)
            {
                if(
Materiali[playerid] > 149)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a pump-action shotgun.");
                    
GivePlayerWeapon(playerid259999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 2)
            {
                if(
Materiali[playerid] > 249)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a MP5.");
                    
GivePlayerWeapon(playerid299999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 3)
            {
                if(
Materiali[playerid] > 499)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a M4 carbine.");
                    
GivePlayerWeapon(playerid319999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 4)
            {
                if(
Materiali[playerid] > 549)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a Spas-12.");
                    
GivePlayerWeapon(playerid279999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                }
            }
        }
    }
    return 
0// Some Script can't used Dialog if you use return 1 .. Lets Make Return 0 for the other script can use dialog

Try this ^^
Reply
#10

Quote:
Originally Posted by Amunra
Посмотреть сообщение
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 7)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                if(
Materiali[playerid] > 399)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a desert eagle.");
                    
GivePlayerWeapon(playerid249999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 1)
            {
                if(
Materiali[playerid] > 149)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a pump-action shotgun.");
                    
GivePlayerWeapon(playerid259999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 2)
            {
                if(
Materiali[playerid] > 249)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a MP5.");
                    
GivePlayerWeapon(playerid299999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 3)
            {
                if(
Materiali[playerid] > 499)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a M4 carbine.");
                    
GivePlayerWeapon(playerid319999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                    return 
1;
                }
            }
            if(
listitem == 4)
            {
                if(
Materiali[playerid] > 549)
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You have crafted yourself a Spas-12.");
                    
GivePlayerWeapon(playerid279999999);
                    return 
1;
                }
                else
                {
                    
SendClientMessage(playeridCOLOUR_WHITE"You dont have enough materials to make that.");
                }
            }
        }
    }
    return 
0// Some Script can't used Dialog if you use return 1 .. Lets Make Return 0 for the other script can use dialog

Try this ^^
DIALOG id 7 has only 3 listitem
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)