25.03.2015, 23:43
So, i got a toll system that is with a command /tolls and it will show you a dialog if you accept it that would take 2.5k blabla. So, i've put it at OnPlayerUpdate. So when the player gets near the range of point it will set a timer like 3 seconds and show you the dialog of the tolls. But the bug is that when i press Yes ( I accept ) it will open them and the dialog will show again after 5 secs ( this works ). But when i press No the dialog keeps showing me after 1 milisecond so i have to CTRL+ALT+DELETE and close the gta.
Code: It's in albanian language..
Code: It's in albanian language..
pawn Code:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 1702.24023, 387.75421, 30.00490))
{
SetTimer("DialogKufini", 3000, false);
}
else if(IsPlayerInRangeOfPoint(playerid, 8.0, 1698.76074, 380.91251, 30.11920))
{
SetTimer("DialogKufini", 3000, false);
}
return 1;
}
pawn Code:
forward DialogKufini(playerid);
public DialogKufini(playerid)
{
if(KufiniStatus[playerid] == 1)
{
KillTimer(DialogKufini(playerid));
}
else
{
SetTimer("ShowAgain", 3000, false); // It's supposed if the Toll status its 0 ( closed ) to Show the dialog again after 3 secs but it wont work.
}
return 1;
}
pawn Code:
forward ShowAgain(playerid);
public ShowAgain(playerid)
{
return cmd_kufini(playerid, " ");
}