GUI help
#1

Hi, so i need help with my gui dialog. When i writing a command GUI log shows up but when i clicing an option nothing hapens :/

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    if(dialogid == 1350)
    {
        new
            string[ 30 ]
            ;
        format(string,sizeof(string), "Pasirinko: %d", listitem);
        SendClientMessage(playerid, RED ,string);

        if( response )
        {
            if( listitem == 0 )
            {
            if(GetPlayerMoney( playerid ) < 5)
            {
            SendClientMessage(playerid, RED ,"* Jūs Neturite 5 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -5);
            SendClientMessage( playerid, RED ,"* Nusipirkote Papildymą Uћ 5Litus ");
            Sistema[ playerid ][ saskaita ]+=5;
            }

            if( listitem == 1 )
            {
            if(GetPlayerMoney( playerid ) < 10)
            {
            SendClientMessage( playerid, RED ,"* Jūs Neturite 10 Litų ");
            return true;
            }
            GivePlayerMoney( playerid,-10);
            SendClientMessage( playerid,RED,"* Nusipirkote Papildymą Uћ 10Litus ");
            Sistema[ playerid ][ saskaita ]+=10;
            }

            if( listitem == 2 )
            {
            if(GetPlayerMoney( playerid ) < 15)
            {
            SendClientMessage( playerid, RED ,"* Jūs Neturite 15 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -15);
            SendClientMessage( playerid, RED ,"* Nusipirkote Papildymą Uћ 15Litus ");
            Sistema[ playerid ][ saskaita ]+=15;
            }

            if( listitem == 3 )
            {
            if(GetPlayerMoney( playerid ) < 20)
            {
            SendClientMessage( playerid, RED ,"* Jūs Neturite 20 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -20);
            SendClientMessage( playerid, RED ,"* Nusipirkote Papildymą Uћ 20Litus ");
            Sistema[ playerid ][ saskaita ]+=20;
            }}
        return true;
    }


    if( dialogid == 1000 )
    {
        new
            string[ 30 ]
            ;
        format(string,sizeof(string), "Pasirinko: %d", listitem);
        SendClientMessage(playerid, RED ,string);
        if( response )
        {
            if(listitem == 0)
            {
            //if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return false;}
            if(GetPlayerMoney( playerid ) < 3000)
            {
            SendClientMessage(playerid, RED ,"* Jūs Neturite 3000Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -3000);
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=1;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 1 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if(GetPlayerMoney( playerid ) < 1500)
            {
            SendClientMessage( playerid, RED ,"* Jūs Neturite 1500 Litų ");
            return true;
            }
            GivePlayerMoney( playerid,-1500);
            SendClientMessage( playerid,RED,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=2;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 2 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if(GetPlayerMoney( playerid ) < 1000)
            {
            SendClientMessage( playerid, RED ,"* Jūs Neturite 1000 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -1000);
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=3;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 3 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if(GetPlayerMoney( playerid ) < 2000)
            {
            SendClientMessage( playerid, RED ,"* Jūs Neturite 2000 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -2000);
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=4;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 4 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if( GetPlayerMoney( playerid ) < 5000)
            {
            SendClientMessage(playerid,RED,"* Jūs Neturite 5000 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -5000);
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=5;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 5 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if( GetPlayerMoney( playerid ) < 2200)
            {
            SendClientMessage(playerid, RED ,"* Jūs Neturite 2200 Litų ");
            return true;
            }
            GivePlayerMoney( playerid , -2200 );
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=6;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 6 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if(GetPlayerMoney( playerid ) < 7000)
            {
            SendClientMessage(playerid, RED ,"* Jūs Neturite 7000 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -7000 );
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=7;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 7 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if( GetPlayerMoney( playerid ) < 1300)
            {
            SendClientMessage(playerid, RED ,"* Jūs Neturite 1300 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -1300);
            SendClientMessage( playerid,RED,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=8;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 8 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if( GetPlayerMoney( playerid ) < 990)
            {
            SendClientMessage(playerid,RED,"* Jūs Neturite 990 Litų ");
            return true;
            }
            GivePlayerMoney( playerid , -990 );
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=9;
            Sistema[ playerid ][ turitel ]=true;
            }

            if( listitem == 9 )
            {
            if(Sistema[ playerid ][ turitel ]){SendClientMessage( playerid ,RED ,"* Jūs jau turite telefoną ");return true;}
            if(GetPlayerMoney( playerid ) < 1250)
            {
            SendClientMessage(playerid,RED,"* Jūs Neturite 1250 Litų ");
            return true;
            }
            GivePlayerMoney( playerid, -1250 );
            SendClientMessage( playerid, RED ,"* Nusipirkote Mobilujį Telefoną ");
            Sistema[ playerid ][ modelis ]=10;
            Sistema[ playerid ][ turitel ]=true;
            }}
        return true;
    }
    return false;
}
So any help?
Reply
#2

I can't help you if you don't use the [pawn] wraparound tags.
Reply
#3

Okay added [pawn]
Reply
#4

That code is extremely messed up, sorry to say.
Reply
#5

Quote:
Originally Posted by Schurman
Посмотреть сообщение
That code is extremely messed up, sorry to say.
So shat should i do?
Reply
#6

Still no fix :/
Reply
#7

  1. Check if your dialog ID is correct and is unique(on conflict with ANY scripts loaded).
  2. Check if there's any other script that have checked the same ID.
  3. See if all the filterscripts with OnDialogResponse callback have returned false if no dialog ID matched.
  4. His script is not that messy, but if you add indentations in those "if( listitem == 0 )" parts it would be better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)