Guest User

Untitled

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