SA-MP Forums Archive
Need fast help! - 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: Need fast help! (/showthread.php?tid=338581)



Need fast help! - Kukkurloom - 30.04.2012

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?


Re: Need fast help! - WLSF - 30.04.2012

switch(1) ...?

pawn Код:
switch(dialogid)

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



Re: Need fast help! - Kukkurloom - 30.04.2012

Now he gives me error like that...

error 010: invalid function or declaration

In the line 340


Re: Need fast help! - Kukkurloom - 30.04.2012

Thanks man I got it!

+rep for that!!!


Re: Need fast help! - WLSF - 30.04.2012

Okay, thanks (: