21.11.2009, 16:03
Quote:
Originally Posted by Naruto4
Thanks mate.(working on it,i let you know if it works)
|
pawn Код:
#define KEY_HORN 2
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_HORN) // If the player is pressing the horn key.
{
if(PlayerToPoint(10.0, i, 2237.188965, 2448.813232, 9.845795) && HasPGP[i] == 1)
{
new sendername[24],string[128];
GetPlayerName(playerid,sendername, sizeof(sendername));
format(string, sizeof(string), "%s pushes a button in his pocket to open the HQ Gate.", sendername);
SendClientMessageToAll(0x00E100FF, string);
MoveObject(pdgateLV, 2237.127930, 2458.059570, 9.840160, 3.5); //open the gate
SetTimer(CloseGate, 7000, 0);
}
}
return 1;
}
forward CloseGate();
public CloseGate()
{
MoveObject(pdgateLV, 2237.188965, 2448.813232, 9.845795, 3.5); // close the gate
return 1;
}