Dialog Problem
#1

FIXED!
Reply
#2

Try:

Code:
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid); 
}
return 1;
}

return 0;
Reply
#3

Quote:
Originally Posted by Blackazur
View Post
Try:

Code:
if(dialogid == DIALOG_RULES)
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
Kick(playerid); 
}
return 1;
}

return 0;
Not working
Reply
#4

Code:
if(dialogid == DIALOG_RULES)
    {
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
            Kick(playerid);
        }
        else if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
        }
        return 1;
    }
Try this, I'm not sure if it works.
Reply
#5

Quote:
Originally Posted by coakiddo
View Post
Code:
if(dialogid == DIALOG_RULES)
    {
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
            Kick(playerid);
        }
        else if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); // Problem
        }
        return 1;
    }
Try this, I'm not sure if it works.
Still not working, No already works fine, but when i click yes nothing happens it only gets me to the skin selection and it should send a client message

EDIT: I also tried to put it under OnPlayerSpawn (i have it under OnPlayerConnect) but OnPlayerSpawn Does the same thing, it doesnt get me to the class selection, it only does nothing.
Reply
#6

Any solution?
Reply
#7

Oh, and i forgot, i have another Dialog with another ID, but the dialog works fine and is not bugged, here is the code for both dialogs

pawn Code:
#define DIALOG_RULES 2
    ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYLE_MSGBOX,"Server Rules!","No Cheating\n- No Spamming\n- Respect Admins\n\nDo you agree to these rules?","Yes","No"); // under on player connect
pawn Code:
}
    if(!strcmp(cmdtext, "/drinks", true))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Drinks For Only 1 , 2 ,3 $", "Sprunk ($1)\nBeer ($2)\nWine ($3)", "Purchase", "Cancel");
        return 1;
Now OnDialogResponse For both:

pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case 1:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -1);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                    }
                    case 1:
                    {
                        if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -2);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                    }
                    case 2:
                    {
                        if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                        GivePlayerMoney(playerid, -3);
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                    }
               }
           }
        }
        return 1;
   
    #define COLOR_GREEN 0x33AA33AA
    #define COLOR_RED 0xAA3333AA
    }
    if(dialogid == DIALOG_RULES)
    {
        if(!response)
        {
            SendClientMessage(playerid, COLOR_RED, "You need to agree to rules to play on the server!");
            Kick(playerid);
        }
        else if(response)
        {
            SendClientMessage(playerid, COLOR_GREEN, "Thank you for agreeing to the server rules!"); //problem
        }
        return 1;
    }
   
    return 0;
}
Compiles with no errors, but still not working, also tried to make it else only, still nothing happens
Reply
#8

Code:
switch(dialogid)
{
    case 1: // /drink dialog
    {
        // Code here
    }
    case 2: // Rules Dialog
    {
        // Code here
    }
}
Use it like this, you really messed up that code.
Reply
#9

Wait, i fixed it!

I removed the return 1; at the end of the drinks dialog and now they both work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)