Advertisement
d0Se

Untitled

Mar 23rd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.86 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4.  //you need to have include #include <foreach>
  5. new cades;
  6. new GateOpen = 0;
  7.  
  8. forward InitiateGamemode();
  9. public InitiateGamemode()
  10. {
  11.     SetTimer("GatesOpen",1000, true);
  12. }
  13.  
  14. public OnPlayerConnect(playerid)
  15. {
  16.     cades = CreateObject(968, 1811.4558, -1894.2816, 12.4562, 0, 0, 0);
  17.     return 1;
  18. }
  19.  
  20. forward GatesOpen();
  21. public GatesOpen()
  22. {
  23.     foreach(new i:Player)
  24.     {
  25.         if(IsPlayerInRangeOfPoint(i, 10.0, 1817.0948, -1890.4753, 13.4163) && GateOpen == 0)
  26.         {
  27.             {
  28.                 MoveObject(cades, 1811.4591, -1894.3032, 13.2392, 5);
  29.                 GateOpen = 1;
  30.                 SetTimer("GatesClose",5000,0);
  31.         }
  32.         }
  33.     }
  34. }
  35.  
  36. forward GatesClose();
  37. public GatesClose()
  38. {
  39.      MoveObject(cades, 1811.4558, -1894.2816, 12.4562, 5);
  40.      GateOpen = 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement