27.12.2012, 13:29
Hello everybody,
I started to do my own mappings for my server, and everytime I add a moving gate, it works fine. But this one don't want to open itself when I am in front of it, pressing CAPLOCKS.
Here is the full code
No errors, and it works fine with other gates, why not this one ? Is there a problem with the coordinates or something ? :
I started to do my own mappings for my server, and everytime I add a moving gate, it works fine. But this one don't want to open itself when I am in front of it, pressing CAPLOCKS.
Here is the full code
No errors, and it works fine with other gates, why not this one ? Is there a problem with the coordinates or something ? :
pawn Код:
new fbielecf1;
new fbielecf2;
pawn Код:
public cop_closeFrontGate(idgate)
{
if(idgate == 25)
{
MoveObject(fbielecf1, 1127.31, -1687.32, 16.10, 1.0, 0.00, 0.00, 90.00); // It's close
}
if(idgate == 26)
{
MoveObject(fbielecf2, 1127.31, -1679.75, 16.10, 1.0, 0.00, 0.00, 90.00); // It's close
}
}
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CROUCH)
{
if(PlayerToPoint(20, playerid, 1132.2382,-1684.1768,13.3459) && PlayerToPoint(20, playerid, 1123.8972,-1683.6736,13.2420) && PlayerInfo[playerid][pMember] == FACT_FBI)
{
MoveObject(fbielecf1, 1127.31, -1696.80, 16.10, 1.0); // It's open
MoveObject(fbielecf2, 1127.31, -1670.75, 16.10, 1.0); // It's open
SetTimerEx("cop_closeGate", 10000, false, "d", 1);
}
}
}
pawn Код:
public createObjects()
{
// [MAPPING FBI]
fbielecf1 = CreateDynamicObject(2990, 1127.31, -1687.32, 16.10, 0.00, 0.00, 90.00); // Close
fbielecf2 = CreateDynamicObject(2990, 1127.31, -1679.75, 16.10, 0.00, 0.00, 90.00); // Close
}