05.06.2013, 16:53
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:
What is wrong with the code spacing that dialog so much
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;
}
}
}
}