09.06.2013, 15:53
Having an issue with a dialog coming up when you enter an area, but the issue is the dialog keeps coming up, any codes or anything needed, and i will surely post them
forward IsPlayerInGArea();
public IsPlayerInGArea()
{
new Float:X, Float:Y, Float:Z;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] != POLICE)
{
GetPlayerPos(i, X, Y, Z);
if (X <= 1798.3859 && X >= 1779.8478 && Y <= -1294.5912 && Y >= -1306.7544)
{
ShowPlayerDialog(i, DIALOG_C, DIALOG_STYLE_MSGBOX, "Pay", "You will have to pay a fee of $1000 to get in", "Pay", "Cancel");
}
}
}
}
new bool:IsInArea[MAX_PLAYERS];
IsInArea[playerid] = false;
public IsPlayerInGArea()
{
new Float:X, Float:Y, Float:Z;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] != POLICE)
{
GetPlayerPos(i, X, Y, Z);
if (X <= 1798.3859 && X >= 1779.8478 && Y <= -1294.5912 && Y >= -1306.7544)
{
if(IsInArea[i] == false)
{
ShowPlayerDialog(i, DIALOG_C, DIALOG_STYLE_MSGBOX, "Pay", "You will have to pay a fee of $1000 to get in", "Pay", "Cancel");
IsInArea[i] = true;
}
}
else
{
if(IsInArea[i] == true) IsInArea[i] = false;
}
}
}
}
So you can use something like this.On the top of the script:
pawn Код:
pawn Код:
pawn Код:
|