Advertisement
Guest User

System Gate

a guest
Mar 23rd, 2019
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. #include <a_samp>
  2. #include <core>
  3. #include <float>
  4.  
  5. new cades;
  6. new GateOpen =0;
  7.  
  8. forward InitiateGamemode();
  9. public InitiateGamemode()
  10. {
  11. SetTimer("GatesOpen",10000,1);//Bo Dem Thoi Gian 1000 = 1 seconds ->> ...
  12. }
  13.  
  14. public OnPlayerConnect(playerid)
  15. {
  16. cades = CreateObject(968, 1811.4558, -1894.2816, 12.4562, 0, 0, 0);//(Object ID 968, , X 1811, Y -1894 , Z 12.4562, ,RotX, RotY, RotZ, Unkown)
  17. return 1;
  18. }
  19.  
  20. forward GatesOpen();
  21. public GatesOpen()
  22. {
  23. for(new i=0; i<MAX_PLAYERS; i++)//Vong Lap Voi Tat Ca Nguoi Choi
  24. {
  25. if(IsPlayerInRangeOfPoint(i, 10.0, 1817.0948, -1890.4753, 13.4163) && GateOpen == 0)//Xac Dinh Duoc Player Co O do khong De no open , Gate 0 moi open
  26. {
  27. {
  28. MoveObject(cades, 1811.4591, -1894.3032, 13.2392, 5);//X,Y,Z Gate Di Chuyen, (Len Tren Cao)
  29. GateOpen =1;//Active Gate (1 = On)
  30. SetTimer("GatesClose",10000,0);//Bo Dem Thoi Gian Cho Bien Ke Tiep la 10 seconds
  31. }
  32. }
  33. }
  34. }
  35.  
  36. forward GatesClose();
  37. public GatesClose()
  38. {
  39. MoveObject(cades, 1811.4558, -1894.2816, 12.4562, 5);//Sau khi Gate Dong no Se Quay Lai X,Y,Z ma ban da Add Vao
  40. GateOpen =0;//Active Gate (0 = Off)
  41. }
  42.  
  43. forward OnPlayerSpawn(playerid);
  44. public OnPlayerSpawn(playerid)
  45. {
  46. SetPlayerPos(playerid, 1817.0948, -1890.4753, 13.4163);
  47. return 1;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement