Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. new Gate, bool:GateClose, bool:GateMoving;
  2.  
  3. public OnFilterScriptInit()
  4. {
  5. Gate = CreateObject(971, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.0);
  6. SetTimer("GateCheck", 7000, true);
  7. return 1;
  8. }
  9.  
  10. forward GateCheck();
  11. public GateCheck()
  12. {
  13. if(!GateMoving)){
  14. for(new i; i<GetMaxPlayers(); i++){
  15. if(IsPlayerConnected(i && IsPlayerInRangeOfPoint(i, 15.0, 0.0, 0.0, 0.0)){
  16. if(GateClose){
  17. GateClose = false;
  18. GateMoving = true;
  19. MoveObject(Gate, 2441.28662109, 1549.55273438, 26.56991768, 3.0);
  20. SetObjectRot(Gate, 0.0, 0.0, 0.0);
  21. }
  22. else{
  23. GateClose = true;
  24. GateMoving = true;
  25. MoveObject(Gate, 0.0, 0.0, 0.0, 3.0);
  26. SetObjectRot(Gate, 0.0, 0.0, 0.0);
  27. }
  28. }
  29. }
  30. }
  31. else{
  32. new Float:P[3];
  33. GetObjectPos(Gate, P[0], P[1], P[2]);
  34. if(!floatcmp(P[0], 0.0) && !floatcmp(P[1], 0.0) && !floatcmp(P[2], 0.0)
  35. GateMoving = false;
  36. }
  37. }
Add Comment
Please, Sign In to add comment