Guest User

FS Cerca Eletrica

a guest
Nov 18th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. /--------------------------------------------/
  2. / Creditos a Bush & Portal.BrasilSamp.top /
  3. /--------------------------------------------/
  4. #include <a_samp>
  5. #define MAX_CERCAS 1
  6. new Cerca[MAX_CERCAS];
  7. new Timer[MAX_PLAYERS];
  8. forward PararAnim(playerid);
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. Cerca[0] = CreateObject(19868, 2035.84497, 1342.75916, 9.81810, 0.00000, 0.00000, 90.00000);
  13. }
  14. public OnPlayerUpdate(playerid)
  15. {
  16. new Float:X,Float:Y,Float:Z;
  17. for(new i = 0; i != MAX_CERCAS; i++)
  18. {
  19. if(GetObjectPos(Cerca[i], X, Y, Z)) //Coloca o id dos objetos usados como cerca eletrica!
  20. {
  21. if(IsPlayerInRangeOfPoint(playerid, 2.0, X, Y, Z))
  22. {
  23. new Float:X2,Float:Y2,Float:Z2,Float:Vida;
  24. GetPlayerHealth(playerid, Vida);
  25. SetPlayerHealth(playerid, Vida-4);
  26. GetPlayerPos(playerid, X2, Y2, Z2);
  27. SetPlayerPos(playerid, X2-2, Y2, Z2);
  28. ApplyAnimation( playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 0 );
  29. Timer[playerid] = SetTimerEx("PararAnim", 8000, false, "i", playerid);
  30. SendClientMessage(playerid, -1, "VocĂȘ encostou numa cerca elĂ©trica e tomou choque!");
  31. return 1;
  32. }
  33. }
  34. }
  35. return 1;
  36. }
  37.  
  38. public PararAnim(playerid)
  39. {
  40. KillTimer(Timer[playerid]);
  41. ClearAnimations(playerid);
  42. return 1;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment