hi, I made gate and barrier in lspd for make server more rpg, the gate opening when cop in that area but the f*cking won't want move up
pawn Код:
new obj;
new obj1;
public OnGameModeInit()
{
cop = SetTimer("CheckCop",1000,1);
obj = CreateObject(975,1589.05493164,-1637.99926758,14.11462784,0.00000000,0.00000000,0.00000000); //object(columbiangate) (2)
obj1 = CreateObject(968,1544.59375000,-1623.92761230,13.07666779,0.00000000,90.00000000,271.99963379); //object(barrierturn) (1)
return 1;
}
forward CheckCop(playerid);
public CheckCop(playerid)
{
if(GetPlayerJobID(playerid) == 2)
{
if(IsPlayerInArea(playerid,1593.1411,1583.0232,-1631.4895,-1642.2267))
{
MoveObject(obj, 1597.30468750,-1638.16821289,14.11462784, 2.00);
}
else if(!IsPlayerInArea(playerid,1593.1411,1583.0232,-1631.4895,-1642.2267))
{
MoveObject(obj, 1589.05493164,-1637.99926758,14.11462784, 2.00);
}
else if(IsPlayerInArea(playerid,1552.2352,1534.5170,-1620.0997,-1633.6525))
{
MoveObject(obj1, 1544.65844727,-1623.93139648,12.94268227,2.00,0.00000000,0.00000000,272.00000000);
}
else if(!IsPlayerInArea(playerid,1552.2352,1534.5170,-1620.0997,-1633.6525))
{
MoveObject(obj1, 1544.59375000,-1623.92761230,13.07666779,2.00,0.00000000,90.00000000,271.99963379);
}
return 1;
}
return 1;
}
stock IsPlayerInArea(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y)
{
new Float:Xa, Float:Ya, Float:Za;
GetPlayerPos(playerid, Xa, Ya, Za);
if(Xa <= max_x && Xa >= min_x && Ya <= max_y && Ya >= min_y) return 1;
return 0;
}