Advertisement
dodostyle

Teste Slap 1.0

May 4th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.71 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. //OBS: PM's Podem ser banidos injustamente (Arrumo isso na versão 2.0)
  4.  
  5.  
  6. //dcmd
  7. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  8.  
  9. //Variaveis Player
  10. new Float:Vida_Player[MAX_PLAYERS];
  11. new Float:Colete_Player[MAX_PLAYERS];
  12.  
  13. //defines...
  14. #define ArmasProibidas 5
  15. //#define PermitiAdm false //Vou fazer nao --'
  16.  
  17. //Defines Tipo de Hack
  18.  
  19. #define Hack_Vida 1
  20. #define Hack_Colete 2
  21. #define Hack_Arma_1 3
  22. #define Hack_Arma_2 4
  23. #define Limpo 5
  24. #define Interior 6
  25.  
  26. //Id's Armas Proibidas
  27. new Armas_Proibidas[0][ArmasProibidas] = {
  28.  
  29. {1,2,3,4,5}
  30. };
  31.  
  32. public OnPlayerConnect(playerid)
  33. {
  34. Vida_Player[playerid] = 0.0;
  35. Colete_Player[playerid] = 0.0;
  36. return 0x01;
  37. }
  38.  
  39. public OnPlayerCommandText(playerid, cmdtext[])
  40. {
  41. dcmd(slap,4,cmdtext);
  42. return 0x01;
  43. }
  44.  
  45. dcmd_slap(playerid, params[])
  46. {
  47. new id, string[128];
  48. if(!strval(params)) return SendClientMessage(playerid, -1, "Digite corretamente: '/Slap ID'");
  49. if(!IsNumeric(params)) return SendClientMessage(playerid, -1, "Digite corretamente: '/Slap ID'");
  50. id = strval(params);
  51. if(IsPlayerConnected(id))
  52. {
  53. format(string, sizeof(string), "[Cheats] Iniciando os testes no Jogador: %s", ReturnPlayer(id));
  54. SendClientMessageToAll(-1, string);
  55. VerificarHack(id);
  56. }
  57. return 0x01;
  58. }
  59. VerificarHack(playerid)
  60. {
  61. if(GetPlayerInterior(playerid) > 0)
  62. {
  63. HackDetect(playerid, Interior);
  64. return 0x01;
  65. }
  66. new Float:x, Float:y, Float:z;
  67. GetPlayerPos(playerid, x, y, z);
  68. GetPlayerHealth(playerid, Vida_Player[playerid]);
  69. GetPlayerArmour(playerid, Colete_Player[playerid]);
  70. SetPlayerHealth(playerid, 100);
  71. SetPlayerArmour(playerid, 100);
  72. SetPlayerPos(playerid, x, y, z+2);
  73. CreateExplosion(x, y, z+2, 0, 5);
  74. SetTimerEx("Verificar_1", 2000, true, "i", playerid);
  75. return 0x01;
  76. }
  77.  
  78. forward Verificar_1(playerid);
  79. public Verificar_1(playerid)
  80. {
  81. new Float:vida, Float:colete;
  82. GetPlayerHealth(playerid, vida);
  83. GetPlayerArmour(playerid, colete);
  84. if(vida == Vida_Player[playerid])
  85. {
  86. HackDetect(playerid, Hack_Vida);
  87. return 0x01;
  88. }
  89. else if(colete == Colete_Player[playerid])
  90. {
  91. HackDetect(playerid, Hack_Colete);
  92. return 0x01;
  93. }
  94. else
  95. {
  96. Verificar_2(playerid);
  97. return 0x01;
  98. }
  99. }
  100.  
  101. forward Verificar_2(playerid);
  102. public Verificar_2(playerid)
  103. {
  104. new IdArma = GetPlayerWeapon(playerid);
  105. if(IdArma > 0)
  106. {
  107. for(new i = 0; i < ArmasProibidas; i++)
  108. {
  109. if(IdArma == Armas_Proibidas[0][i])
  110. {
  111. HackDetect(playerid, Hack_Arma_1);
  112. return 0x01;
  113. }
  114. }
  115. new weapons[13][2];
  116. for(new i = 0; i < 13; i++)
  117. {
  118. GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]); //Ainda acho que usei muitas loops :(
  119. for(new j = 0; j < ArmasProibidas; j++)
  120. {
  121. if(Armas_Proibidas[0][j] == weapons[i][0])
  122. {
  123. HackDetect(playerid, Hack_Arma_2);
  124. return 0x01;
  125. }
  126. }
  127. }
  128. }
  129. else
  130. {
  131. Verificar_3(playerid);
  132. return 0x01;
  133. }
  134. return 0x01;
  135. }
  136.  
  137. forward Verificar_3(playerid);
  138. public Verificar_3(playerid)
  139. {
  140. //Passou Todas as Opções
  141. HackDetect(playerid, Limpo);
  142. return 0x01;
  143. }
  144.  
  145. //Banir ou Voltar a vida do Jogador
  146.  
  147. HackDetect(playerid, tipo)
  148. {
  149. new string[128];
  150. if(tipo == Hack_Vida)
  151. {
  152. format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Health Hack", ReturnPlayer(playerid));
  153. SendClientMessageToAll(-1, string);
  154. Kick(playerid);
  155. return 0x01;
  156. }
  157. else if(tipo == Hack_Colete)
  158. {
  159. format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Armour Hack", ReturnPlayer(playerid));
  160. SendClientMessageToAll(-1, string);
  161. Kick(playerid);
  162. return 0x01;
  163. }
  164. else if(tipo == Hack_Arma_1)
  165. {
  166. format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Weapon Hack Tipo 1", ReturnPlayer(playerid));
  167. SendClientMessageToAll(-1, string);
  168. Kick(playerid);
  169. return 0x01;
  170. }
  171. else if(tipo == Hack_Arma_2)
  172. {
  173. format(string, sizeof(string), "[Cheats] Jogador: %s Foi banido | Motivo: Weapon Hack Tipo 2", ReturnPlayer(playerid));
  174. SendClientMessageToAll(-1, string);
  175. Kick(playerid);
  176. return 0x01;
  177. }
  178. else if(tipo == Limpo)
  179. {
  180. SetPlayerHealth(playerid, Vida_Player[playerid]);
  181. SetPlayerArmour(playerid, Colete_Player[playerid]);
  182. format(string, sizeof(string), "[Cheats] Jogador: %s Passou no teste de Cheat's", ReturnPlayer(playerid));
  183. SendClientMessageToAll(-1, string);
  184. return 0x01;
  185. }
  186. else if(tipo == Interior)
  187. {
  188. SetPlayerHealth(playerid, Vida_Player[playerid]);
  189. SetPlayerArmour(playerid, Colete_Player[playerid]);
  190. format(string, sizeof(string), "[Cheats] Jogador: %s | Erro (Interior)", ReturnPlayer(playerid));
  191. SendClientMessageToAll(-1, string);
  192. return 0x01;
  193. }
  194. return 0x01;
  195. }
  196.  
  197. //Pegar Nick do Jogador
  198. stock ReturnPlayer(playerid)
  199. {
  200. new name[MAX_PLAYER_NAME];
  201. GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  202. return name;
  203. }
  204.  
  205. stock IsNumeric(const num[])
  206. {
  207. for (new i = 0, j = strlen(num); i < j; i++)
  208. if (num[i] > '9' || num[i] < '0')
  209. return 0;
  210. return 0x01;
  211. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement