Dialog doesn't work.
#4

Dialogs sometimes conflict with other which have the same dialogid. So make sure that the dialogid of DIALOG_INVITEFR and DIALOG_ISFRIEND are not used anywhere else.

You can also debug it and see if it's called when a player responses to those dialogids
pawn Код:
// ...
    if(dialogid == DIALOG_INVITEFR)
    {
        if(response)
        {
            print("DIALOG_INVITEFR is being called..");
            new str[128];
            new friend[24];
            new pid;
            if(!IsInvitedFriend(playerid, friend)) {
                AddFriend(playerid, friend);
                format(str, sizeof(str), "You invite %s to friends.", friend);
                SendClientMessage(playerid, Colour_Green, str);
                for(new i=0; i<MAX_PLAYERS; i++) {
                    if(IsPlayerConnected(i)) {
                        if(strcmp(GetPlayerNick(i), friend, true) == 0) {
                            format(str, sizeof(str), "%s invited you to friends! '/accept %d' to accept friend.", GetPlayerNick(playerid), playerid);
                            SendClientMessage(pid, Colour_Yellow, str);
                        }
                    }
                }
            }
        }
        return 1;
    }
    if(dialogid == DIALOG_ISFRIEND)
    {
        if(response)
        {
            print("DIALOG_ISFRIEND is being called..");
            switch(listitem)
            {
                case 0:
                {
                    new Clickedplayerid = GetPVarInt(playerid, "Clicked");
                    new Float:x,Float:y,Float:z;
                    GetPlayerPos(Clickedplayerid, x,y,z);
                    SetPlayerPos(playerid, x,y,z+3);
                }
            }
        }
        return 1;
    }
    return 0;
}
Test it and let us know whether it printed the messages or not.

PS: switch is faster than using if statement about dialogid.
Reply


Messages In This Thread
Dialog doesn't work. - by Creax - 15.11.2013, 16:36
Re: Dialog doesn't work. - by Konstantinos - 15.11.2013, 16:49
Re: Dialog doesn't work. - by Creax - 16.11.2013, 10:46
Re: Dialog doesn't work. - by Konstantinos - 16.11.2013, 10:52
Re: Dialog doesn't work. - by Creax - 16.11.2013, 11:27
Re: Dialog doesn't work. - by Konstantinos - 16.11.2013, 11:33
Re: Dialog doesn't work. - by Creax - 16.11.2013, 11:59
Re: Dialog doesn't work. - by Konstantinos - 16.11.2013, 12:06
Re: Dialog doesn't work. - by Creax - 16.11.2013, 12:24
Re: Dialog doesn't work. - by Konstantinos - 16.11.2013, 12:29

Forum Jump:


Users browsing this thread: 1 Guest(s)