Advertisement
Guest User

fly

a guest
Feb 6th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. new timer[MAX_PLAYERS];
  2. new savetp[MAX_PLAYERS];
  3. new dives[MAX_PLAYERS];
  4.  
  5. /*
  6. native SetPlayerPosition(pid,Float:X,Float:Y,Float:Z);
  7. */
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print(" Antifly");
  14. return 1;
  15. }
  16. #else
  17.  
  18. main()
  19. {
  20. }
  21.  
  22. #endif
  23. public OnPlayerConnect(playerid)
  24. {
  25. dives[playerid] = 0;
  26. return 1;
  27. }
  28. public OnPlayerUpdate(playerid)
  29. {
  30. if(GetPlayerAnimationIndex(playerid))
  31. {
  32. new animlib[32];
  33. new animname[32];
  34. GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
  35. if(strcmp(animlib, "SWIM", true) == 0)
  36. {
  37. new Float:X,Float:Y,Float:Z;
  38. GetPlayerPos(playerid,X,Y,Z);
  39. if(Z >= 8.45)
  40. {
  41. if(!IsPlayerInRangeOfPoint(playerid,37.85,1964.0404,-1199.6774,17.4400))
  42. {
  43. dives[playerid] = 1;
  44. }
  45. }
  46. }
  47. GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
  48. if(strcmp(animname, "FALL_FALL", true) == 0)
  49. {
  50. new Float:X,Float:Y,Float:Z;
  51. GetPlayerPos(playerid,X,Y,Z);
  52. SetPVarFloat(playerid,"Float",Z);
  53. SetTimer("Checkhim",1200,false);
  54. }
  55. }
  56. new index = GetPlayerAnimationIndex(playerid);
  57. if(index >= 958 && index <= 962)
  58. {
  59. if(GetPlayerWeapon(playerid) != 46)
  60. {
  61. dives[playerid] = 1;
  62. }
  63. }
  64. if(dives[playerid] == 1)
  65. {
  66. SendClientMessage(playerid,0xC30000FF,"You are banned Reason: Flyhack");
  67. Ban(playerid);
  68. for(new i = 0; i < MAX_PLAYERS; i++)
  69. {
  70. if(IsPlayerAdmin(i))
  71. {
  72. new string[100];
  73. new name[100];
  74. format(string,sizeof(string),"%s has been banned Reason: Flyhack",GetPlayerName(playerid,name,sizeof(name)));
  75. SendClientMessage(i,0xC30000FF,string);
  76. }
  77. }
  78. }
  79. return 1;
  80. }
  81. stock SetPlayerPosition(pid,Float:X,Float:Y,Float:Z)
  82. {
  83. savetp[pid] = 1;
  84. SetPlayerPos(pid,X,Y,Z);
  85. KillTimer(timer[pid]);
  86. timer[pid] = SetTimer("remtp",15000,false);
  87. }
  88. forward remtp(playerid);
  89. public remtp(playerid)
  90. {
  91. savetp[playerid] = 0;
  92. return 1;
  93. }
  94. forward Checkhim(playerid);
  95. public Checkhim(playerid)
  96. {
  97. new Float:X,Float:Y,Float:Z;
  98. GetPlayerPos(playerid,X,Y,Z);
  99. if(Z > GetPVarFloat(playerid,"Float"))
  100. {
  101. if(savetp[playerid] != 1)
  102. {
  103. dives[playerid] = 1;
  104. }
  105. }
  106. return 1;
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement