Open and Close Gate
#1

Hello,

I did one gate and now I've made the function to open and close the gate, using the horn key (H or Caps Lock). But I just did the function to open (press one time the horn key) and what I want, it's if press again the horn key, the gate will close.

Here is my code:

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if((newkeys == KEY_HORN) && (IsPlayerInAnyVehicle(playerid))){
    if(GetDistanceBetweenPlayerobj(playerid,xxxxx, xxxxx, xxxxx) < 15){
      MoveObject(gate1,xxxxx, xxxxxx, xxxxx);
      SendClientMessage(playerid, COLOR_RED, "You've opened the Gate.");
      return 1;
	} 
  } return 0;
}
This is working, I already tested. Just need to add the close inside the code!
If someone can help

Thanks!
Reply


Messages In This Thread
Open and Close Gate - by shark - 15.06.2009, 01:30
Re: Open and Close Gate - by Moustafa - 15.06.2009, 01:41
Re: Open and Close Gate - by shark - 15.06.2009, 01:48
Re: Open and Close Gate - by Moustafa - 15.06.2009, 06:06
Re: Open and Close Gate - by shark - 15.06.2009, 09:08
Re: Open and Close Gate - by Studio - 15.06.2009, 11:58
Re: Open and Close Gate - by JoeDaDude - 15.06.2009, 12:02
Re: Open and Close Gate - by shark - 15.06.2009, 12:37
Re: Open and Close Gate - by Moustafa - 15.06.2009, 15:28
Re: Open and Close Gate - by shark - 15.06.2009, 16:05

Forum Jump:


Users browsing this thread: 1 Guest(s)