Seha_

gate kameni

Aug 20th, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <a_samp>
  2. new Gate, bool:GateClosed = true;
  3.  
  4. public OnGameModeInit()
  5. {
  6. Gate = CreateObject(19362, -2467.0032, 2233.3865, 3.8310, 0.0, 0.0, 90, 100.0);
  7. SetTimer("GateCheck", 7000, true);
  8. return 1;
  9. }
  10.  
  11. forward GateCheck();
  12. public GateCheck()
  13. {
  14. if(!IsObjectMoving(Gate)){
  15. for(new i; i<GetMaxPlayers(); i++){
  16. if(IsPlayerConnected(i && IsPlayerInRangeOfPoint(i, 15.0, -2467.0032, 2233.3865, 3.8310)){
  17. if(GateClosed){
  18. GateClosed = false;
  19. MoveObject(Gate, -2467.0032, 2233.3865, 6.8310, 3.0, 0.0, 0.0, 90);
  20. }
  21. else{
  22. GateClosed = true;
  23. MoveObject(Gate, -2467.0032, 2233.3865, 3.8310, 3.0, 0.0, 0.0, 90);
  24. }
  25. }
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment