Toll Booth System Gate not closing
#1

Hey guys,

So I have made a tollbooth for my server. When you get in range of the booth, it takes the money and the gate opens. Then I have made a timer that counts 5 seconds and the boom should close, but its not. Any help?
Everything works perfectly fine except the boom isn't moving back into place after 5 seconds.

At the top of the script:
Код:
new TollBoothPaid[MAX_PLAYERS];
new TollBoothLV = 0;
OnGameModeInit:
Код:
TollBoothLV = CreateDynamicObject(968, 1624.58130, 136.62405, 35.83821,   0.00000, 270.00000, 167.99652);
OnPlayerUpdate:
Код:
if(IsPlayerInRangeOfPoint(playerid, 5, 1626.1011,124.8513,36.3228))
		{
		    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		    {
			    if(TollBoothPaid[playerid] == 0)
			    {
				    new string[128];
				    PlayerInfo[playerid][pCash] -= TOLL_BOOTH_FEE;
				    MoveDynamicObject(TollBoothLV, 1624.5881, 136.6429, 35.8382, 1, -0.0, -0.0, -0.0);
				    format(string, sizeof(string), "The toll booth has cost you: $%i. You have 5 seconds to get through.", TOLL_BOOTH_FEE);
				    SendClientMessage(playerid, COLOR_YELLOW, string);
					TollBoothLV = 1;
				    TollBoothPaid[playerid] = 1;
				    SetTimer("tollboothlv", 5000, false);
				    return 1;
			    }
		    }
		}
Timer:
Код:
forward tollbothlv(playerid)
public tollboothlv(playerid)
{
	TollBoothPaid[playerid] = 0;
	if(TollBoothLV == 1)
	{
		TollBoothLV = 0;
    	MoveDynamicObject(TollBoothLV, 1624.5813, 136.6241, 35.8382, 1, -0.0, -0.0, -0.0);
    }
}
Reply


Messages In This Thread
Toll Booth System Gate not closing - by Blademaster680 - 09.01.2014, 14:47
Re: Toll Booth System Gate not closing - by J4mmyHD - 09.01.2014, 15:00
Re: Toll Booth System Gate not closing - by Burridge - 09.01.2014, 15:03
Re: Toll Booth System Gate not closing - by Blademaster680 - 09.01.2014, 15:05
Re: Toll Booth System Gate not closing - by iBots - 09.01.2014, 15:40
Re: Toll Booth System Gate not closing - by Blademaster680 - 09.01.2014, 15:59

Forum Jump:


Users browsing this thread: 1 Guest(s)