helber

[FS]Fogueira Realista

Feb 16th, 2013
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. //=========================================
  2. // Samp Louco - Tudo Para Seu Servidor! =
  3. // www.samplouco.blogspot.com.br =
  4. //=========================================
  5.  
  6. #include <a_samp>
  7. #define FILTERSCRIPT
  8. #include <zcmd>
  9.  
  10.  
  11. forward ApagarFogo(playerid);
  12. public ApagarFogo(playerid) {
  13.  
  14. SendClientMessage(playerid, -1, "[INFO] A fogueira foi apagada !! ");
  15.  
  16. /*
  17. TextDrawHideForPlayer(playerid, introTextDraw2);
  18. TextDrawHideForPlayer(playerid, introTextDraw3);
  19. TextDrawHideForPlayer(playerid, introTextDraw5);
  20. */
  21. SetCameraBehindPlayer(playerid);
  22. TogglePlayerControllable(playerid, true);
  23.  
  24. DestroyObject(GetPVarInt(playerid, "fogueira2"));
  25. DestroyObject(GetPVarInt(playerid, "fogueira1"));
  26.  
  27. ClearAnimations(playerid);
  28. ClearAnimations(playerid);
  29.  
  30. return true;
  31. }
  32.  
  33.  
  34. forward TerminarFogueira(playerid);
  35. public TerminarFogueira(playerid) {
  36.  
  37. static
  38. Float:px,
  39. Float:py,
  40. Float:pz;
  41.  
  42. GetObjectPos(GetPVarInt(playerid, "fogueira1"), px, py, pz);
  43.  
  44. ClearAnimations(playerid);
  45.  
  46. SetPVarInt(playerid, "Fogueira", SetTimerEx("ApagarFogo", 15000, false, "i", playerid));
  47.  
  48. SendClientMessage(playerid, -1, "[INFO] Você acendeu a fogueira");
  49.  
  50. ApplyAnimation(playerid,"MISC","SEAT_LR",4.1,0,0,0,1,1);
  51.  
  52. SetPVarInt(playerid, "fogueira2", CreateObject(18688, px,py,pz-1.47,0.0,0.0,0.0));
  53.  
  54. return true;
  55.  
  56. }
  57.  
  58.  
  59. cmd(fogueira, playerid, params[]) {
  60.  
  61. TogglePlayerControllable(playerid, false);
  62.  
  63. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,1,0);
  64.  
  65. static
  66. Float:px,
  67. Float:py,
  68. Float:pz,
  69. Float:pa;
  70.  
  71. GetPlayerPos(playerid, px, py, pz);
  72. GetPlayerFacingAngle(playerid, pa);
  73.  
  74. px += floatsin ( -pa, degrees) * 2.5;
  75. py += floatcos ( -pa, degrees) * 2.5;
  76.  
  77. SetPVarInt(playerid, "fogueira1", CreateObject(841, px,py,pz-0.5,0.0,0.0,0.0));
  78.  
  79. SetPlayerCameraPos(playerid, px +2, py+2, pz+3.5);
  80.  
  81. SetPlayerCameraLookAt(playerid, px, py, pz);
  82.  
  83. /*
  84. TextDrawShowForPlayer(playerid, introTextDraw2);
  85. TextDrawShowForPlayer(playerid, introTextDraw3);
  86. TextDrawShowForPlayer(playerid, introTextDraw5);
  87. */
  88.  
  89. SetPVarInt(playerid, "Fogueira", SetTimerEx("TerminarFogueira", 5000, false, "i", playerid));
  90.  
  91. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,1,0);
  92. return true;
  93. }
  94.  
  95. //=========================================
  96. // Samp Louco - Tudo Para Seu Servidor! =
  97. // www.samplouco.blogspot.com.br =
  98. //=========================================
Advertisement
Add Comment
Please, Sign In to add comment