[HELP] I need help on making a gate that you can open with a Scripted Keypad
#5

here is a own made gate

1.On Top

pawn Код:
new rmgate1a;//Gate #1
new rmgate1b;//Gate #1
rmg1o = 0;
and
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
2.GameModeInit
pawn Код:
rmgate1a = CreateObject(988, -1782.020386, 972.715332, 24.773438, 0.0000, 0.0000, 270.0000);
rmgate1b = CreateObject(988, -1781.970215, 967.119690, 24.773438, 0.0000, 0.0000, 270.0000);
3.OnPlayerKeyStateChange

pawn Код:
if (PRESSED (KEY_FIRE))
{
if(IsPlayerInRangeOfPoint(playerid, 15, -1782.3981, 969.9249, 24.7344))
{
if(GetPlayerTeam(playerid) == 2)
{
if(rmg1o == 0)
{
MoveObject(rmgate1a, -1782.005981, 977.717468, 24.773438, 2.5);
MoveObject(rmgate1b, -1781.962891, 962.813721, 24.773438, 2.5);
rmg1o = 1;
}
else if(rmg1o == 1)
{
MoveObject(rmgate1a, -1782.020386, 972.715332, 24.773438, 2.5);
MoveObject(rmgate1b, -1781.970215, 967.119690, 24.773438, 2.5);
rmg1o = 0;
}
}
}
}
edit it and will be perfect for you
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)