Problems with binding the HORN button.
#1

Hey!
I've been trying to bind the HORN button with my gate so whenever I horn it would open.
But it doesn't work while I'm driving or so. [You must stop before you horn in order it to open]

Code:

PHP код:
        if(GetPlayerFaction(playerid) == COPS && newkeys == && IsPlayerInAnyVehicle(playerid) && IsPlayerDriver(playerid))
                {
                        if(
IsPlayerInRangeOfPoint(playerid,20,1588.5000000,-1638.3000000,14.1000000))
                        {
                                switch(
Gate1)
                                {
                                        case 
true:
                                        {
                                                
MoveObject(Gate[0],1598.5000000,-1638.3000000,14.1000000,5);
                                                
Gate1 false;
                                        }
                                        case 
false:
                                        {
                                                
MoveObject(Gate[0],1588.5000000,-1638.3000000,14.1000000,5);
                                                
Gate1 true;
                                        }
                                }
                        }
                        if(
IsPlayerInRangeOfPoint(playerid,10,1544.7000000,-1630.8000000,13.1000000))
                        {
                                switch(
Gate2)
                                {
                                        case 
true:
                                        {
                                                
                                                
SetTimer("pdcubegate7"100false);
                                                
SetTimer("ResetPD1",10000,0);
                                        }
                                        case 
false:
                                        {
                                                
                                                
SetTimer("pdcubegate15"100false);
                                        }
                                }
                        }
                } 
Thanks in advance!
Reply
#2

use KEY_CROUCH
Reply
#3

Quote:
Originally Posted by mahardika
Посмотреть сообщение
use KEY_CROUCH
Wow, had no idea it could fix it haha! Thanks +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)