How to create keypad on this code
#1

I want to create a keypads on the door of LSPD.\
This is the code for opening the door.
PHP код:
if(IsPlayerInRangeOfPoint(playerid2,250.611,63.2995,1003.18))
            {
                if(
lspd1 == 0)
                {
                      
MoveDynamicObject(lspddoor1250.611,63.2995,1000.644.5000);
                      
SendClientMessage(playeridCOLOR_BLUE,"SAPD door is open, please close it!");
                      
GetPlayerName(playeridsendernamesizeof(sendername));
                      
format(stringsizeof(string), "* %s takes his/her remote control and opens the door."sendername);
                      
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                      
lspd1 1;
                }
                else
                {
                      
MoveDynamicObject(lspddoor1250.611,63.2995,1003.044.5000);
                      
SendClientMessage(playeridCOLOR_BLUE,"SAPD door is closed, thank you!");
                      
GetPlayerName(playeridsendernamesizeof(sendername));
                      
format(stringsizeof(string), "* %s takes his/her remote control and closes the door."sendername);
                      
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                      
lspd1 0;
                } 
I want only LSPD members can open the doors.
Reply
#2

Removed
Reply
#3

Quote:
Originally Posted by 1Deagle1
Посмотреть сообщение
Код:
if(IsPlayerInRangeOfPoint(playerid, 2,250.611,63.2995,1003.18)) 
            { 
                if(lspd1 == 1) 
                { 
                      MoveDynamicObject(lspddoor1, 250.611,63.2995,1000.64, 4.5000); 
                      SendClientMessage(playerid, COLOR_BLUE,"SAPD door is open, please close it!"); 
                      GetPlayerName(playerid, sendername, sizeof(sendername)); 
                      format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername); 
                      ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); 
                      lspd1 = 1; 
                } 
                else 
                { 
                      MoveDynamicObject(lspddoor1, 250.611,63.2995,1003.04, 4.5000); 
                      SendClientMessage(playerid, COLOR_BLUE,"SAPD door is closed, thank you!"); 
                      GetPlayerName(playerid, sendername, sizeof(sendername)); 
                      format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername); 
                      ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); 
                      lspd1 = 0; 
                }
Hope it helped.
What you edited ? where is the keypad ?
Reply
#4

Removed
Reply
#5

No,i don't see key pads ?
I mean keypads like this https://www.******.bg/search?q=keypa...PEg-gQUPa0M%3A
Reply
#6

Hello!

Do you want this with an textdraw or should the members type in a password?
Reply
#7

Thanks.I want with textdraw.Becouse i don't want members of the server to enter the PD.I want only LSPD members when press F to open the door and the door to close after 2 seconds.And the other side of the door i want too to have keypad with the same functions.Thanks and sorry for my bad english.
Reply
#8

Anyone ?
Reply
#9

PHP код:
if(newkeys YOUR KEY && IsPlayerInRangeOfPoint(playerid2,250.611,63.2995,1003.18))
    {
           if(
gTeam[playerid] != YOUR TEAM)
        {
            
SendClientMessage(playerid,COLOR_ERROR,"Acces denied");
            return 
1;
        }
                if(
lspd1 == 0)
                {
                      
MoveDynamicObject(lspddoor1250.611,63.2995,1000.644.5000);
                      
SendClientMessage(playeridCOLOR_BLUE,"SAPD door is open, please close it!");
                      
GetPlayerName(playeridsendernamesizeof(sendername));
                      
format(stringsizeof(string), "* %s takes his/her remote control and opens the door."sendername);
                      
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                      
lspd1 1;
                }
                else
                {
                      
MoveDynamicObject(lspddoor1250.611,63.2995,1003.044.5000);
                      
SendClientMessage(playeridCOLOR_BLUE,"SAPD door is closed, thank you!");
                      
GetPlayerName(playeridsendernamesizeof(sendername));
                      
format(stringsizeof(string), "* %s takes his/her remote control and closes the door."sendername);
                      
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                      
lspd1 0;
                } 
EDIT: It should be placed under OnPlayerKeyStateChange.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)