Need fast help!
#1

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    {
    switch(
1// Dialog for shop
    
{
        case 
1:
        {
            if(!
response)
            {
                
SendClientMessage(playerid0xFF0000FF"You didn't wanted to buy anything.");
                return 
1// ...
            
}
            switch(
listitem)
            {
                case 
0// Items
                
{
                    
GivePlayerMoney(playerid,-10);
                }
                case 
1:
                {
                    
GivePlayerMoney(playerid,-5);
                }
                case 
2:
                {
                    
GivePlayerMoney(playerid,-25);
                }
                case 
3:
                {
                    
GivePlayerMoney(playerid,-33);
                }
                case 
4:
                {
                    
GivePlayerMoney(playerid,-22);
                }
                case 
5:
                {
                    
GivePlayerMoney(playerid,-6);
                }
                case 
6:
                {
                    
GivePlayerMoney(playerid,-21);
                }
                case 
7:
                {
                    
GivePlayerMoney(playerid,-12);
                }
                case 
8:
                {
                    
GivePlayerMoney(playerid,-42);
                }
                
// Add the rest of your listitems for dialog 1 here
            
}
        }
        
// Add the rest of your dialogs here
    
}
    return 
0// If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
}
    return 
1;

Gives me error like that :

Line 341 : warning 225: unreachable code

What should I do?
Reply
#2

switch(1) ...?

pawn Код:
switch(dialogid)

pawn Код:
public OnDialogResponse ( playerid, dialogid, response, listitem, inputtext [] )
{
    switch ( dialogid )
    {
        //...
        //Your code...
    }
}
Reply
#3

Now he gives me error like that...

error 010: invalid function or declaration

In the line 340
Reply
#4

Thanks man I got it!

+rep for that!!!
Reply
#5

Okay, thanks (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)