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

Okay, what I am basically asking is how to Open a door/gate with a Scripted Keypad by using the Return Key, Example: I am trying to access a room with a safe. The doors are shut and It has a keypad besides the entrance, and a animation that looks like your typing or pulling on the keypad, then the door opens then closes automatically
Reply
#2

Check out these:

https://sampwiki.blast.hk/wiki/MoveObject
https://sampwiki.blast.hk/wiki/Game_Object_ID_List
https://sampwiki.blast.hk/wiki/ApplyAnimation
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/SetTimer

Study those and you should get it. The game object ID list is for finding the id of that key pad sort.

-Lorenc
Reply
#3

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
Alright, I'll be sure to study. I need to know how to do it, If anybody knows how feel free to reply back please
Reply
#4

haha, first of all create the keypad, the door
then i got no idea wut kind of keypad u want but ill suggest just doing as strcmp this: /1363
its the easiest way though
then apply animation (search for it)
then move the object sumwhere up/down/left/right
then set a timer to close the door automatically. done
Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)