Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Gate, bool:GateClose, bool:GateMoving;
- public OnFilterScriptInit()
- {
- Gate = CreateObject(971, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0);
- SetTimer("GateCheck", 7000, true);
- return 1;
- }
- forward GateCheck();
- public GateCheck()
- {
- if(!GateMoving)){
- for(new i; i<GetMaxPlayers(); i++){
- if(IsPlayerConnected(i && IsPlayerInRangeOfPoint(i, 15.0, 0.0, 0.0, 0.0)){
- if(GateClose){
- GateClose = false;
- GateMoving = true;
- MoveObject(Gate, 2441.28662109, 1549.55273438, 26.56991768, 3.0);
- SetObjectRot(Gate, 0.0, 0.0, 0.0);
- }
- else{
- GateClose = true;
- GateMoving = true;
- MoveObject(Gate, 0.0, 0.0, 0.0, 3.0);
- SetObjectRot(Gate, 0.0, 0.0, 0.0);
- }
- }
- }
- }
- else{
- new Float:P[3];
- GetObjectPos(Gate, P[0], P[1], P[2]);
- if(!floatcmp(P[0], 0.0) && !floatcmp(P[1], 0.0) && !floatcmp(P[2], 0.0)
- GateMoving = false;
- }
- }
Add Comment
Please, Sign In to add comment