20.01.2014, 15:03
Код:
#include <zcmd> #include <sscanf2> new DoorTimer = -1; new GateTimer = -1; new SFPDDoor1; new SFPDMegan[2]; COMMAND:gate(playerid, params[]) { if(Faction[playerid] == 1 || Faction[playerid] == 2) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 144.8837, 222.4300, 1023.4175))//Position Open { MoveDynamicObject(SFPDDoor1, 144.8837, 220.9900, 1023.4175, 1); if(DoorTimer != -1) KillTimer(DoorTimer); DoorTimer = SetTimer("CloseDoor",6000, false); } else if(IsPlayerInRangeOfPoint(playerid, 5.0, 136.92101, 253.46291, 1023.41882)) { MoveDynamicObject(SFPDMegan[0], 137.9010, 253.4629, 1023.4188, 1);//Position Open MoveDynamicObject(SFPDMegan[1], 132.8810, 253.4629, 1023.4188, 1);//Position Open if(GateTimer != -1) KillTimer(GateTimer); GateTimer = SetTimer("CloseGate",6000, false); } } else { SendClientMessage(playerid,0xFFFFFFFF,"Youґre not in that Fraction"); } return 1; } forward CloseDoor(); public CloseDoor() { MoveDynamicObject(SFPDDoor1, 144.8837, 222.4300, 1023.4175, 1);//Position Close if(DoorTimer != -1) { KillTimer(DoorTimer); DoorTimer = -1; } } forward CloseGate(); public CloseGate() { MoveDynamicObject(SFPDMegan[0], 136.92101, 253.46291, 1023.41882, 1);//Position Close MoveDynamicObject(SFPDMegan[1], 133.92101, 253.46291, 1023.41882, 1);//Position Close if(GateTimer != -1) { KillTimer(GateTimer); GateTimer = -1; } }