02.07.2016, 13:32
Quote:
I forgot about that streamer function Vince mentioned so no need of variables to check if the objects are moving.
pawn Код:
|
second doors are not opening anymore i get no text that it opens and closes and they're not moving anymore.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(job[playerid] == POLICE)
{
if((newkeys & 8 && !IsPlayerInAnyVehicle(playerid)) || (newkeys & KEY_HANDBRAKE && IsPlayerInAnyVehicle(playerid)))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, -1641.1395,686.5178,7.1875))
{
if (!IsDynamicObjectMoving(POLICEGATE[0]))
{
if (!GATEMODE) // DOORMODE is false
{
MoveDynamicObject(POLICEGATE[0], -1641.55225, 688.7032, 6.18130, 3.0);
SendClientMessage(playerid, zalia, "Gate is opening");
VARTUMODE = true;
}
else // DOORMODE is true
{
MoveDynamicObject(POLICEGATE[0], -1641.55225, 687.22321, 6.18130, 3.0);
SendClientMessage(playerid, raudona, "Gate is closing");
GATEMODE = false;
}
}
else if(IsPlayerInRangeOfPoint(playerid, 4.0, -1641.1897,679.5863,7.1875))
{
if (!IsDynamicObjectMoving(POLICEGATE[1]))
{
if(!VARTUMODE2) // DOORMODE is false
{
MoveDynamicObject(POLICEGATE[1], -1641.60791, 679.52722, 11.5965, 3.0);
SendClientMessage(playerid, zalia, "Gate is opening");
GATEMODE2 = true;
}
else // DOORMODE is true
{
MoveDynamicObject(POLICEGATE[1], -1641.60791, 679.52722, 7.67200, 3.0);
SendClientMessage(playerid, raudona, "Gate is closing");
GATEMODE2 = false;
}
}
}
}
}
}
return 1;
}