Command to Key?
#4

This is working

pawn Код:
new Opened = 0; //Start of the script, under include and defines

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) //Outside any function or other callback
{
  if(newkeys == KEY_SUBMISSION) //if the new keys are KEY_SUBMISSION (Mouse Cen)
  {
      if(IsPlayerInRangeOfPoint(playerid, 150000.0, -1395.03, 2850.07, 95.78)) //If the player is in range of that point
      {
          if(!Opened) //If is not opened
          {
            MoveObject (AdminGate, -1395.03, 2850.07, 101.43, 3);//Move the object
            SendClientMessage(playerid, COLOR_RED, "Welcome to heaven");//Send the message
            Opened = true; //Set variable "Opened" to true, so the server will know it's opened
          }
          else //Else
          {
            MoveObject (AdminGate, -1395.03, 2850.07, 95.78, 3);//Move the object
            SendClientMessage(playerid, COLOR_RED, "The gate is closing! Be back soon sugahpuffs!");//Send the message
            Opened = false; //Set variable "Opened" to false, so the server will know it's not opened          
          }
      }
  }
  return 1;
}
Reply


Messages In This Thread
Command to Key? - by ColdIce - 31.05.2011, 16:28
Re: Command to Key? - by Sasino97 - 31.05.2011, 16:38
Re: Command to Key? - by ColdIce - 31.05.2011, 17:10
Re: Command to Key? - by Sasino97 - 31.05.2011, 17:15
Re: Command to Key? - by ColdIce - 31.05.2011, 17:35
Re: Command to Key? - by ColdIce - 31.05.2011, 17:39
Re: Command to Key? - by sim_sima - 31.05.2011, 17:55
Re: Command to Key? - by ColdIce - 31.05.2011, 17:56
Re: Command to Key? - by ColdIce - 31.05.2011, 18:02
Re: Command to Key? - by Sasino97 - 01.06.2011, 11:09

Forum Jump:


Users browsing this thread: 1 Guest(s)