Why is this dialog spacing this much?
#1

Alright so I've made a script that should display a dialog if the house is for sale to either choose to enter the house, or to purchase it.
Now when I press enter while being in range in that area, it starts spacing.

Here is a video describing the problem better, and you see the 'spacing':

[ame]http://www.youtube.com/watch?v=d71mNgXDNKc[/ame]


Now this is the code:
pawn Код:
if((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
    {
        if(PInfo[playerid][InHouseID] > 0)
        {
            new intid = HInfo[PInfo[playerid][InHouseID]][Interior];
            new hid = PInfo[playerid][InHouseID];
            if(IsPlayerInRangeOfPoint(playerid, 3, Interiors[intid][IntX], Interiors[intid][IntY], Interiors[intid][IntZ]))
            {
                SetPlayerInterior(playerid, 0);
                SetPlayerVirtualWorld(playerid, 0);
                SetPlayerPos(playerid, HInfo[hid][eX], HInfo[hid][eY], HInfo[hid][eZ]);
                PInfo[playerid][InHouseID] = 0;
                return 1;
            }
        }
        for(new i = 0; i < sizeof(HInfo); i++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 1.5, HInfo[i][eX],HInfo[i][eY],HInfo[i][eZ]))
            {
                if(HInfo[i][ForSale] == 1)
                {
                    new string[70];
                    format(string, sizeof(string), "Currently visiting %s's house", HInfo[i][OwnedBy]);
                    ShowPlayerDialog(playerid, DIALOG_FORSALEHOUSE1, DIALOG_STYLE_LIST, string, "Enter House\nPurchase House", "Ok", "Cancel");
                    return 1;
                }
                else
                if(!strcmp(HInfo[i][OwnedBy],"None"))
                {
                    new string[70];
                    format(string, sizeof(string), "Currently visiting %s's house", HInfo[i][OwnedBy]);
                    ShowPlayerDialog(playerid, DIALOG_FORSALEHOUSE1, DIALOG_STYLE_LIST, string, "Enter House\nPurchase House", "Ok", "Cancel");
                    PInfo[playerid][LastDialogHouse] = i;
                    return 1;
                }
            }
        }
    }
What is wrong with the code spacing that dialog so much
Reply
#2

What under dialogresponse on dialogid: DIALOG_FORSALEHOUSE1 ?
Reply
#3

Nothing yet:

pawn Код:
case DIALOG_FORSALEHOUSE1:
        {
            if(!response)
            {
               
            }
            else
            {

            }
        }
Reply
#4

Did you try only
pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK)
Reply
#5

If I understand, when entering the checkpoint, the dialog continues to pop up (when you click enter) ?

If I'm correct, this is because it's inside the loop.
Reply
#6

No, you have to press either enter or F to let it pop up.

When I press enter (in the checkpoint) it should give me the dialog, but instead when I press it it shows, and when I release it, it's gone.

Quote:
Originally Posted by Richie©
Посмотреть сообщение
Did you try only
pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK)
I did.
Reply
#7

Not fixed yet.
Anyone who could help me with this?
Reply
#8

Put this near defines
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Reply
#9

Quote:
Originally Posted by SimpalK
Посмотреть сообщение
Put this near defines
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
That won't matter.

It's that ENTER is doing weird shit. and F is working fine, although it has the same key binding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)