Horn key to open gate
#4

Quote:
Originally Posted by Ahmed21
Посмотреть сообщение
PHP код:
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
      if((
newkeys KEY_CTRL_BACK) && !(oldkeys KEY_CTRL_BACK))  //If the player uses the horn "clicks H"
      
{
              new 
pState GetPlayerState(playerid);
              if(
IsPlayerInAnyVehicle(playerid) && pState == PLAYER_STATE_DRIVER//If the player is driving a car
              
{
                      new 
Float:GatePosXFloat:GatePosYFloat:GatePosZ;
                      
GetObjectPos(GateObjectIDGatePosXGatePosYGatePosZ); //Replace the GateObjectID with your gate object id.
                      
if(IsPlayerInRangeOfPoint(playerid5.0GatePosXGatePosYGatePosZ)) //If the player is near the gate.
                      
{
                             
MoveObject(GateObjectIDNewPosXNewPosYNewPosZ5.0NewPosRotationXNewPosRotationYNewPosRotationZ);
                             
//5.0 = Moving Speed
                      
}
               }
       }
       return 
1;

Wow thank you.
Reply


Messages In This Thread
Horn key to open gate - by jimdo - 08.08.2016, 07:00
Re: Horn key to open gate - by Micko123 - 08.08.2016, 07:02
Re: Horn key to open gate - by Ahmed21 - 08.08.2016, 12:11
Re: Horn key to open gate - by Viggo - 08.08.2016, 12:22
Re: Horn key to open gate - by jimdo - 08.08.2016, 12:24
Re: Horn key to open gate - by Ahmed21 - 08.08.2016, 12:28

Forum Jump:


Users browsing this thread: 1 Guest(s)