16.06.2010, 09:31
Your script looks like a gate open and close code.
So, here's how you can do it:
Put this at the top:
Then under OnGameModeInit()
So, here's how you can do it:
Put this at the top:
Код:
new bool: gateopen;
Код:
gateopen=false;
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new sendername[24]; GetPlayerName(playerid,sendername, sizeof(sendername)); if(PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pMember] == 10) { if ((newkeys & KEY_HORN) && !(oldkeys & KEY_HORN)) { if(PlayerToPoint(20.0, playerid, 1811.3328,-1890.3472,13.4070)) { if(gateopen==false) { new string[128]; MoveObject(taxigate,1810.8123779297, -1890.3559570313, 10.59866809845, 1.5); format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); gateopen=true; } if(gateopen==true) { new string[128]; MoveObject(taxigate,1810.927734375, -1890.3482666016, 14.12285900116, 1.5); format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); gateopen=false; } } } } return 1; }