09.01.2014, 14:47
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:
OnGameModeInit:
OnPlayerUpdate:
Timer:
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;
Код:
TollBoothLV = CreateDynamicObject(968, 1624.58130, 136.62405, 35.83821, 0.00000, 270.00000, 167.99652);
Код:
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; } } }
Код:
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); } }