07.01.2014, 13:05
(
Последний раз редактировалось Blademaster680; 07.01.2014 в 13:54.
)
Hey guys.
So I am making a tollbooth system for my server but when the player gets into range it will open the gate and spam the chat and keeps taking money while they are in range. I have also made a timer but it isn't closing the gate in 5 seconds.
This is the code:
OnPlayerUpdate
OnGameModeInit
Hopefully one of you can solve this?
Thanks
So I am making a tollbooth system for my server but when the player gets into range it will open the gate and spam the chat and keeps taking money while they are in range. I have also made a timer but it isn't closing the gate in 5 seconds.
This is the code:
Код:
new TollBoothLV = 0;
Код:
if(IsPlayerInRangeOfPoint(playerid, 5, 1626.1011,124.8513,36.3228))
{
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);
TollBoothPaid[playerid] = 1;
SetTimer("tollboothlv", 5000, false);
return 1;
}
}
forward tollboothlv(playerid);
public tollboothlv(playerid)
{
TollBoothPaid[playerid] = 0;
MoveDynamicObject(TollBoothLV, 1624.58130, 136.62405, 35.83821, 1, -0.0, -0.0, -0.0);
}
Код:
TollBoothLV = CreateDynamicObject(968, 1624.58130, 136.62405, 35.83821, 0.00000, 270.00000, 167.99652);
Thanks


