Guest User

Gantzyo

a guest
Sep 14th, 2009
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #include <a_samp>
  2. //=========================[Colores]=========================//
  3. #define amarillo 0xFFE700FF
  4. #define rojo 0xFF0000FF
  5. //========================[FORWARDs]=========================//
  6. forward SubirBarrera();
  7. forward BajarBarrera();
  8. //==========================[NEWs]===========================//
  9. new barrera;
  10. new moviendo_barrera = 0;
  11. //===========================================================//
  12. public OnFilterScriptInit()
  13. {
  14. print("\n+======================+");
  15. print("| Barrera Los Santos |");
  16. print("| by |");
  17. print("| Gantzyo |");
  18. print("+======================+\n");
  19. CreateObject(966,1544.696,-1630.775,12.350,0.0,0.0,-90.000);
  20. CreateObject(966,1544.665,-1630.773,12.350,0.0,0.0,-90.000);
  21. barrera = CreateObject(968,1544.619,-1623.936,13.111,0.0,90.000,-90.000);//1544.619,-1623.936,13.111,0.0,0.000,-90.000
  22. return 1;
  23. }
  24. public OnFilterScriptExit()
  25. {
  26. print("\n+======================+");
  27. print("| Barrera Los Santos |");
  28. print("| by |");
  29. print("| Gantzyo |");
  30. print("+======================+\n");
  31. return 1;
  32. }
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35. if(!strcmp(cmdtext,"/barrera",true))
  36. {
  37. if(moviendo_barrera > 0) return SendClientMessage(playerid,rojo,"Ya se esta abriendo la barrera");
  38. SetTimer("SubirBarrera",30,0);
  39. moviendo_barrera = 1;
  40. return 1;
  41. }
  42. return 0;
  43. }
  44. public SubirBarrera()
  45. {
  46. if(moviendo_barrera == 1)
  47. {
  48. new Float:rotX,Float:rotY,Float:rotZ;
  49. GetObjectRot(barrera,rotX,rotY,rotZ);
  50. SetObjectRot(barrera,rotX,rotY-1,rotZ);
  51. if(rotY-1 == 0.000)
  52. {
  53. SetTimer("BajarBarrera",3000,0);
  54. moviendo_barrera = 2;
  55. }
  56. else SetTimer("SubirBarrera",30,0);
  57. }
  58. return 1;
  59. }
  60. public BajarBarrera()
  61. {
  62. if(moviendo_barrera == 2)
  63. {
  64. new Float:rotX,Float:rotY,Float:rotZ;
  65. GetObjectRot(barrera,rotX,rotY,rotZ);
  66. SetObjectRot(barrera,rotX,rotY+1,rotZ);
  67. if(rotY+1 == 90.000) moviendo_barrera = 0;
  68. else SetTimer("BajarBarrera",30,0);
  69. }
  70. return 1;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment