Command to Key?
#2

Quote:
Originally Posted by ColdIce
Посмотреть сообщение
Hello

pawn Код:
if(strcmp(cmdtext,"/openagate", true) == 0) {
     {
        if(IsPlayerInRangeOfPoint(playerid, 150000.0, -1395.03, 2850.07, 95.78)) {
            MoveObject (AdminGate, -1395.03, 2850.07, 101.43, 3);
            SendClientMessage(playerid, COLOR_RED, "Welcome to heaven");
        } else {
            return SendClientMessage(playerid,0xFFFFFF,"You aren't in range!");
        }
    }
    return 1;
}

if(strcmp(cmdtext,"/closeagate", true) == 0) {
     {
        if(IsPlayerInRangeOfPoint(playerid, 150000.0, -1395.03, 2850.07, 101.43)) {
            MoveObject (AdminGate, -1395.03, 2850.07, 95.78, 3);
            SendClientMessage(playerid, COLOR_RED, "The gate is closing! Be back soon sugahpuffs!");
        } else {
            return SendClientMessage(playerid,0xFFFFFF,"You aren't in range!");
        }
    }
    return 1;
}
return 0;
}
Is there a way to change that so that I can just press X and then the gate opens/closes instead of using the commands?
X is not avaiable, but there are other keys.

pawn Код:
new Opened = 0;

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  if(newkeys == KEY_SUBMISSION)
  {
      if(IsPlayerInRangeOfPoint(playerid, 150000.0, -1395.03, 2850.07, 95.78))
      {
          if(!Opened)
          {
            MoveObject (AdminGate, -1395.03, 2850.07, 101.43, 3);
            SendClientMessage(playerid, COLOR_RED, "Welcome to heaven");
            Opened = true;
          }
          else
          {
            MoveObject (AdminGate, -1395.03, 2850.07, 95.78, 3);
            SendClientMessage(playerid, COLOR_RED, "The gate is closing! Be back soon sugahpuffs!");
            Opened = false;
          }
      }
  }
  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: 2 Guest(s)