Badyx

[FS] BadyX - Security [Beta V.1.0]

Aug 3rd, 2013
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.88 KB | None | 0 0
  1. /*      BadyX Security      */
  2.  
  3. /*      Notas adicionales:
  4.  
  5.         Fecha de inicio del script:     <====>      Martes, 30 de Julio de 2013
  6.        
  7.         ==========================    ¿Que detecta?   ==========================
  8.        
  9.         1) - Hack de dinero.
  10.         2) - Hack de vida.
  11.         3) - Hack de chaleco.
  12.         4) - Jeckpack.
  13.         5) - Hack de armas.
  14.         6) - Teleport interior coches.
  15.        
  16.         ==============================    Debug   ==============================
  17.         Martes, 30 de Julio de 2013:
  18.        
  19.         - Comienzo del script.
  20.         - Echo sistema de advertencias.
  21.         - Sistema de logs para poder revisar las advertencias (Advertencias y baneados).
  22.         - Sistema anticheats de dinero en funcionamiento ( 100 x 100 ).
  23.         - Sistema anticheats de vida en funcionamiento ( Falta que detecte al perder vida ).
  24.         - Sistema anticheats de chaleco en funcionamiento (  Falta que detecte al perder chaleco ).
  25.        
  26.         Miercoles, 31 de Julio de 2013:
  27.  
  28.         - Se a comenzado con el anticheats de armas (Por ahora sin exito).
  29.         - Sistema anticheats de jeckpack.  ( 100 x 100 ).
  30.        
  31.         Viernes, 2 de Agosto de 2013:
  32.        
  33.         - Se a terminado el sistema de anticheats de armas (Las pruebas realizadas son positivas) (Probar a retornar en 0 para que no puedan usarlas o que expulse dando una advertencia)
  34.         - Se a comenzado con el sistema de anti hack de municion (Sin terminar)
  35.         - Se a comenzado con el sistema de anti hack de anti healt car (Sin terminar)
  36.        
  37.         ========================================================================
  38.        
  39.         ===========================    Instalacion   ===========================
  40.        
  41.         - Para utilizar el anticheats de dinero:
  42.        
  43.             Se usara la siguiente funcion "DarDinero(playerid, Cantidad);"
  44.            
  45.             DarDinero sera el nombre de la funcion
  46.             playerid al usuario que se le dara el dinero
  47.             Cantidad sera la cantidad que queramos dar ( en numero ).
  48.            
  49.         - Para utilizar el anticheats de Vida:
  50.        
  51.             Se usara la siguiente funcion "VidaPlayer(playerid, Cantidad);"
  52.  
  53.             VidaPlayer sera el nombre de la funcion
  54.             playerid al usuario que se le dara el dinero
  55.             Cantidad sera la cantidad que queramos dar ( en numero ).
  56.            
  57.         - Para utilizar el anticheats de Chaleco:
  58.  
  59.             Se usara la siguiente funcion "ChalecoPlayer(playerid, Cantidad)"
  60.  
  61.             ChalecoPlayer sera el nombre de la funcion
  62.             playerid al usuario que se le dara el dinero
  63.             Cantidad sera la cantidad que queramos dar ( en numero ).
  64.            
  65.         - Para utilizar el anticheats de Armas:
  66.  
  67.             Se usara la siguiente funcion "DarArma(playerid,Arma,Municion);"
  68.  
  69.             DarArma sera el nombre de la funcion.
  70.             playerid al usuario que se le dara el dinero.
  71.             Arma sera la ID del arma a dar ( en numero ).
  72.             Municion sera la cantidad de municion a dar ( en numero ).
  73.            
  74.             Nota:
  75.             En este sistema se contempla tambien el anticheats de municion.
  76.         ========================================================================
  77.        
  78.        
  79.        
  80. */
  81.  
  82. #include <a_samp>
  83.  
  84. /*  Macros  */
  85.  
  86. #define funcion%0(%1) \
  87.                      forward %0(%1); \
  88.                                     public %0(%1)
  89.  
  90. /*  Colores */
  91.  
  92. #define Azul        0x33CCFFAA
  93.  
  94.  
  95. /*  Timers  */
  96.  
  97. //new TimerCheatsDinero;
  98. //new TimerCheatsCoches;
  99. /*      Variables       */
  100. /*  Dinero  */
  101. new Dinero[MAX_PLAYERS];            /*  Variable con la cantidad de dinero de cada usuario      */
  102.  
  103. /*  AntiHackVida    */
  104. new Float:VidaUsuario[MAX_PLAYERS];
  105. new Float:ChalecoUsuario[MAX_PLAYERS];
  106.  
  107.  
  108. /*  AntiHack de armas y municion    */
  109.  
  110. new ArmasUsuario[MAX_PLAYERS][47];
  111. new MunicionUsuario[MAX_PLAYERS][47];
  112.  
  113. /*  Variables coches    */
  114. new Float:VidaCoches[MAX_VEHICLES];
  115. //new Float:VidaCoches[MAX_VEHICLES];
  116.  
  117. /*  Variables globales  */
  118.  
  119. new Advertencias[MAX_PLAYERS];      /*  Si llega a 3 el usuario sera baneado automaticamente    */
  120.  
  121. new bool:EsAdministrador;    /*  Para poder acceder al menu rcon */
  122. new Spawn[MAX_PLAYERS];      /*  Evita que se den advertencias al entrar     */
  123. new Motivos[MAX_PLAYERS][6];
  124. new Advertido[MAX_PLAYERS];
  125. /*  0) - Hack dinero.
  126.     1) - Hack de vida.
  127.     2) - Hack de chaleco.
  128.     3) - JeckPack.
  129.     4) - Hack de armas.
  130.     5) - Municion.
  131. */
  132. //new Activador[MAX_PLAYERS][3];
  133.  
  134. #if defined FILTERSCRIPT
  135.  
  136. public OnFilterScriptInit()
  137. {
  138.     print("\n\n\n[Anticheats]  --==== BadyX Security activado ====--");
  139.     SetTimer("ComprobarCheats", 1000, true);
  140.     return 1;
  141. }
  142.  
  143. public OnFilterScriptExit()
  144. {
  145.     KillTimer(TimerCheatsDinero);
  146.     KillTimer(TimerCheatsCoches);
  147.     print("\n\n\n[Anticheats]  --==== BadyX Security desactivado ====--");
  148.     return 1;
  149. }
  150.  
  151. #else
  152.  
  153. main()
  154. {
  155.     print("\n----------------------------------");
  156.     print(" Blank Gamemode by your name here");
  157.     print("----------------------------------\n");
  158. }
  159.  
  160. #endif
  161.  
  162. funcion OnPlayerConnect(playerid)
  163. {
  164.     SetearVariables(playerid);
  165.     ComprobarAdmin(playerid);
  166.     return 1;
  167. }
  168.  
  169. funcion OnPlayerDeath(playerid, killerid, reason)
  170. {
  171.     return 1;
  172. }
  173.  
  174. funcion OnVehicleSpawn(vehicleid)
  175. {
  176.     return 1;
  177. }
  178.  
  179. funcion OnVehicleDeath(vehicleid, killerid)
  180. {
  181.  
  182.     return 1;
  183. }
  184.  
  185. funcion OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  186. {
  187.  
  188.     return 1;
  189. }
  190.  
  191. funcion OnPlayerExitVehicle(playerid, vehicleid)
  192. {
  193.  
  194.     return 1;
  195. }
  196.  
  197.  
  198. funcion OnPlayerSpawn(playerid)
  199. {
  200.     new DineroLegal;
  201.     DineroLegal = GetPlayerMoney(playerid);
  202.     Dinero[playerid] = DineroLegal;
  203.     VidaPlayer(playerid, 50);       /* Con esto evitaremos errores al spawnear    */
  204.     ChalecoPlayer(playerid, 50);    /* Con esto evitaremos errores al spawnear    */
  205.     SetTimerEx("RealSpawn",3000,false,"i",playerid);
  206.     return 1;
  207. }
  208.  
  209. funcion OnPlayerStateChange(playerid, newstate, oldstate)
  210. {
  211.  
  212.    
  213. }
  214.  
  215. funcion OnPlayerCommandText(playerid, cmdtext[])
  216. {
  217.     if (strcmp("/Dararma", cmdtext, true, 10) == 0)
  218.     {
  219.         DarArma(playerid,24,50);
  220.         return 1;
  221.     }
  222.  
  223.    
  224.     if (strcmp("/darcha", cmdtext, true, 10) == 0)
  225.     {
  226.         ChalecoPlayer(playerid, 50);
  227.         return 1;
  228.     }
  229.  
  230.     if (strcmp("/vervida", cmdtext, true, 10) == 0)
  231.     {
  232.         new Float:HP;
  233.         GetPlayerHealth(playerid, HP);
  234.         if(HP ==   VidaUsuario[playerid])
  235.         {
  236.             SendClientMessage(playerid, -1, # [Anticheats] Vida legal);
  237.             return 1;
  238.         }
  239.         else
  240.         {
  241.             SendClientMessage(playerid, -1, # [Anticheats] Deja de chetarte vida);
  242.         /*  ReestablecerDinero(playerid,   Dinero[playerid]);
  243.             DarAdvertencia(playerid);
  244.             break;*/
  245.             return 1;
  246.         }
  247.     //  return 1;
  248.     }
  249.  
  250.     if (strcmp("/DarDinero", cmdtext, true, 10) == 0)
  251.     {
  252.         DarDinero(playerid, 5000);
  253.         return 1;
  254.     }
  255.    
  256.     if (strcmp("/darvida", cmdtext, true, 10) == 0)
  257.     {
  258.         VidaPlayer(playerid, 50);
  259.         return 1;
  260.     }
  261.    
  262.     if (strcmp("/RepararVehiculo", cmdtext, true, 10) == 0)
  263.     {
  264.         new IDCoche;
  265.         IDCoche = GetPlayerVehicleID(playerid);
  266.         VidaAuto(IDCoche, 0);
  267.         return 1;
  268.     }
  269.     return 0;
  270. }
  271.  
  272.  
  273. funcion ChalecoPlayer(playerid, Float:Chaleco)
  274. {
  275.     ChalecoUsuario[playerid] =Chaleco;
  276.     SetPlayerArmour(playerid, Chaleco);
  277.     return 1;
  278. }
  279.  
  280. funcion ReestablecerChaleco(playerid, Float:Chaleco)
  281. {
  282.     SetPlayerArmour(playerid, Chaleco);
  283.     ChalecoUsuario[playerid] =Chaleco;
  284.    
  285.     return 1;
  286. }
  287.  
  288.  
  289.  
  290.  
  291. funcion VidaPlayer(playerid, Float:Vida)
  292. {
  293.     VidaUsuario[playerid] =Vida;
  294.     SetPlayerHealth(playerid, Vida);
  295.     return 1;
  296. }
  297.  
  298. funcion VidaAuto(IDCoche, Float:Vehicle_Health)
  299. {
  300.     GetVehicleHealth(IDCoche, Vehicle_Health);
  301.     SetVehicleHealth(IDCoche, Vehicle_Health);
  302.     VidaCoches[IDCoche] = Vehicle_Health;
  303.     return 1;
  304. }
  305.  
  306.  
  307.  
  308.  
  309. funcion ReestablecerVida(playerid, Float:Vida)
  310. {
  311.     SetPlayerHealth(playerid, Vida);
  312.     VidaUsuario[playerid] =Vida;
  313.     return 1;
  314. }
  315.  
  316.  
  317. funcion DarDinero(playerid, Cantidad)
  318. {
  319.     GivePlayerMoney(playerid, Cantidad);
  320.     Dinero[playerid] += Cantidad;
  321.     SendClientMessage(playerid, -1, # Pasta legal entregada);
  322.     return 1;
  323. }
  324.  
  325. funcion ReestablecerDinero(playerid, Cantidad)
  326. {
  327.     ResetPlayerMoney(playerid);
  328.     GivePlayerMoney(playerid, Cantidad);
  329.     Dinero[playerid] = Cantidad;
  330.     return 1;
  331. }
  332.  
  333. funcion RealSpawn(playerid)
  334. {
  335.     Spawn[playerid] = 0;
  336.     SendClientMessage(playerid, -1, # El tiempo a terminado );
  337.     return 1;
  338. }
  339.  
  340. funcion DarArma(playerid,Arma,Municion)
  341. {
  342. ArmasUsuario[playerid][Arma]=true;
  343. MunicionUsuario[playerid][Arma] += Municion;
  344. GivePlayerWeapon(playerid,Arma,Municion);
  345. return 1;
  346. }
  347.  
  348. funcion ComprobarCheats()
  349. {
  350.  
  351.     for(new i; i < MAX_PLAYERS; i++)
  352.     {
  353.         if(Spawn[i] == 1)    continue;
  354.         if(GetPlayerSpecialAction(i) == 2)
  355.         {
  356.         SendClientMessage(i , -1, # [Anticheats] Se te detecto un jeckpack );
  357.         Motivos[i][3] = 1;
  358.         DarAdvertencia(i);
  359.         break;
  360.         }
  361.         new Float:aX,Float:aY,Float:aZ;
  362.         GetPlayerVelocity(i, aX, aY, aZ);
  363.         if(aX <= -0.800000  || aY <= -0.800000 || aZ <= -0.800000)
  364.         {
  365.             SendClientMessage(i , -1, # [Anticheats] Se a detectado AirBreak);
  366.             break;
  367.         }
  368.         new Float:fX, Float:fY, Float:fZ;
  369.         new animacion = GetPlayerAnimationIndex(i);
  370.         GetPlayerPos(i, fX, fY, fZ);
  371.         if((animacion >= 1538) && (animacion <= 1542) && fZ > 5)
  372.         {
  373.             SendClientMessage(i , -1, # [Anticheats] Se a detectado AirBreak);
  374.             break;
  375.         }
  376.        
  377.        
  378.         if(GetPlayerMoney(i) ==   Dinero[i])    /*  Anti hack de dinero */
  379.         {
  380.  
  381.         }
  382.         else
  383.         {
  384.             ReestablecerDinero(i,   Dinero[i]);
  385.             Motivos[i][0] = 1;
  386.             DarAdvertencia(i);
  387.             break;
  388.         }
  389.         new Float:HP;
  390.         GetPlayerHealth(i, HP);
  391.         if(HP ==   VidaUsuario[i])    /*  Anti hack de vida */
  392.         {
  393.  
  394.         }
  395.         else
  396.         {
  397.             ReestablecerVida(i,   VidaUsuario[i]);
  398.             Motivos[i][1] = 1;
  399.             DarAdvertencia(i);
  400.             break;
  401.         }
  402.         new Float:armor;
  403.         GetPlayerArmour(i, armor);
  404.         if(armor ==   ChalecoUsuario[i])    /*  Anti hack de chaleco */
  405.         {
  406.            
  407.         }
  408.         else
  409.         {
  410.             ReestablecerChaleco(i,   ChalecoUsuario[i]);
  411.             Motivos[i][2] = 1;
  412.             DarAdvertencia(i);
  413.  
  414.             break;
  415.         }
  416.     }
  417.     return 1;
  418. }
  419.  
  420. /*
  421. funcion ComprobarCoches(playerid)
  422. {
  423.  
  424.     for(new i; i < MAX_VEHICLES; i++)
  425.     {
  426.         if(Spawn[i] == 1)    continue;
  427.     }
  428.     return 1;
  429. }*/
  430.  
  431.  
  432. funcion DarAdvertencia(playerid)
  433. {
  434.     new string[200];
  435.     Advertencias[playerid] += 1;
  436.     new hour,minuite,second;
  437.     gettime(hour,minuite,second);
  438.     new year, month,day;
  439.     getdate(year, month, day);
  440.     BorrarChat(playerid,20);
  441.     new Motivo[20];
  442.  
  443.     if(Motivos[playerid][0] == 1) { Motivo = "Cheat de dinero"; }
  444.     else if(Motivos[playerid][1] == 1) { Motivo = "Cheat de vida"; }
  445.     else if(Motivos[playerid][2] == 1) { Motivo = "Cheat de chaleco"; }
  446.     else if(Motivos[playerid][3] == 1) { Motivo = "Jetpack"; }
  447.     else if(Motivos[playerid][4] == 1) { Motivo = "Cheat de armas"; }
  448.     else if(Motivos[playerid][5] == 1) { Motivo = "Cheat de Municion"; }
  449.     SendClientMessage(playerid, Azul, # [Anticheats] Recibiste una advertencia );
  450.     format(string, sizeof(string), "Motivo %s.\nTienes un total de %d advertencias", Motivo, Advertencias[playerid]);
  451.     SendClientMessage(playerid, Azul, string);
  452.     format(string, sizeof(string), "[Anticheats] El Usuario %s fue advertido\n[(A las %d Minuto %d Segundo %d) Dia %d Mes %d Año %d)]", NombreEx(playerid) , hour, minuite,second , day,  month, year);
  453.     LogAdvertencias(string);
  454. /*  if(Advertencias[playerid] > 2)
  455.     {
  456.     BorrarChat(playerid,20);
  457.     format(string, sizeof(string), "[Anticheats] Fuiste baneado del servidor por una acumulación total de %d advertencias", Advertencias[playerid]);
  458.     SendClientMessage(playerid, Azul, string);
  459.     format(string, sizeof(string), "[Anticheats] El Usuario %s fue baneado", NombreEx(playerid));
  460.     LogBaneados(string);
  461.     return 1;
  462.     }*/
  463.     for(new slot = 0; slot != 6; slot++)
  464.     {
  465.         Motivos[playerid][slot] = 0;
  466.     }
  467.    
  468.     return 1;
  469. }
  470.  
  471.  
  472. funcion SetearVariables(playerid)
  473. {
  474.     for(new slot = 0; slot != 6; slot++)
  475.     {
  476.         Motivos[playerid][slot] = 0;
  477.     }
  478.     for(new i=0;i<47;i++)
  479.     {
  480.     ArmasUsuario[playerid][i]=false;
  481.     MunicionUsuario[playerid][i]=0;
  482.     }
  483.     Dinero[playerid] = 0;
  484.     Advertencias[playerid] = 0;
  485.     Spawn[playerid] = 1;
  486.     Advertido[playerid] = 0;
  487.  
  488.    
  489.     return 1;
  490. }
  491.  
  492. funcion LogAdvertencias(string[])
  493. {
  494.     new entry[256];
  495.     format(entry, sizeof(entry), "%s\r\n",string);
  496.     new File:hFile;
  497.     hFile = fopen("Logs/Advertidos.ini", io_append);
  498.     fwrite(hFile, entry);
  499.     fclose(hFile);
  500. }
  501.  
  502. funcion LogBaneados(string[])
  503. {
  504.     new entry[256];
  505.     format(entry, sizeof(entry), "%s\r\n",string);
  506.     new File:hFile;
  507.     hFile = fopen("Logs/Baneados.ini", io_append);
  508.     fwrite(hFile, entry);
  509.     fclose(hFile);
  510. }
  511.  
  512.  
  513. funcion ComprobarAdmin(playerid)
  514. {
  515.     EsAdministrador = false;
  516.     new nick[MAX_PLAYER_NAME];
  517.     GetPlayerName(playerid, nick, sizeof(nick));
  518.     if(!strcmp(nick, "BadyX", true))  {     EsAdministrador = true;   return 1; }
  519.     //else if(!strcmp(nick, "Soporte_Metropolis", true))
  520.  
  521.  
  522.     return 1;
  523. }
  524.  
  525. funcion OnPlayerLeaveCheckpoint(playerid)
  526. {
  527.     return 1;
  528. }
  529.  
  530. funcion OnPlayerEnterRaceCheckpoint(playerid)
  531. {
  532.     return 1;
  533. }
  534.  
  535. funcion OnPlayerLeaveRaceCheckpoint(playerid)
  536. {
  537.     return 1;
  538. }
  539.  
  540. funcion OnRconCommand(cmd[])
  541. {
  542.  
  543.     return 1;
  544. }
  545.  
  546. funcion OnPlayerRequestSpawn(playerid)
  547. {
  548.     return 1;
  549. }
  550.  
  551. funcion OnObjectMoved(objectid)
  552. {
  553.     return 1;
  554. }
  555.  
  556. funcion OnPlayerObjectMoved(playerid, objectid)
  557. {
  558.     return 1;
  559. }
  560.  
  561. funcion OnPlayerPickUpPickup(playerid, pickupid)
  562. {
  563.     return 1;
  564. }
  565.  
  566. funcion OnVehicleMod(playerid, vehicleid, componentid)
  567. {
  568.     return 1;
  569. }
  570.  
  571. funcion OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  572. {
  573.     return 1;
  574. }
  575.  
  576. funcion OnVehicleRespray(playerid, vehicleid, color1, color2)
  577. {
  578.     return 1;
  579. }
  580.  
  581. funcion OnPlayerSelectedMenuRow(playerid, row)
  582. {
  583.     return 1;
  584. }
  585.  
  586. funcion OnPlayerExitedMenu(playerid)
  587. {
  588.     return 1;
  589. }
  590.  
  591. funcion OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  592. {
  593.     return 1;
  594. }
  595.  
  596. funcion OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  597. {
  598.     new string[128];
  599.     if(newkeys & KEY_FIRE)
  600.     {
  601.         new IDArma = GetPlayerWeapon(playerid);
  602.         if(IDArma != 0 && !ArmasUsuario[playerid][IDArma] && IDArma != 40)
  603.         {
  604.         Motivos[playerid][4] = 1;
  605.         DarAdvertencia(playerid);
  606.         ResetPlayerWeapons(playerid);
  607.         return 1;
  608.         }
  609.         else
  610.         {
  611.         return 1;
  612.         }
  613.     }
  614.     if(newkeys & KEY_FIRE)
  615.     {
  616.         new IDArma = GetPlayerWeapon(playerid);
  617.         new gunAmmo = GetPlayerAmmo(playerid);
  618.         if(gunAmmo !=0 && !MunicionUsuario[playerid][IDArma] && IDArma != 40)
  619.         {
  620.         Motivos[playerid][4] = 1;
  621.         DarAdvertencia(playerid);
  622.         ResetPlayerWeapons(playerid);
  623.         return 1;
  624.         }
  625.         else
  626.         {
  627.         return 1;
  628.         }
  629.     }
  630.    
  631.     if(newkeys & KEY_WALK)
  632.     {
  633.     if(ObtenerVelocidad(playerid) > 50)
  634.     {
  635.         switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
  636.         {
  637.         case 0,460,476,511..513,519,520,553,577,592,593: printf("[ID: %d] Sobrepasó la velocidad de 230km/h pero utilizando un vehículo válido.");
  638.         default:
  639.         {
  640.             new Float:sX, Float:sY, Float:sZ;
  641.             GetPlayerPos(playerid, sX, sY, sZ);
  642.             format(string, sizeof(string), "[ANTICHEAT] El jugador [ID: %d] ha sido golpeado. Razón: Utilización de Sobeit (Speed Hack).", playerid);
  643.             SendClientMessageToAll(-1, string);
  644.             RemovePlayerFromVehicle(playerid);
  645.             SetPlayerPos(playerid, sX, sY, sZ+5);
  646.             return 1;
  647.         }
  648.     }
  649.     }
  650.     }
  651.     return 1;
  652. }
  653.  
  654. funcion OnRconLoginAttempt(ip[], password[], success)
  655. {
  656.     for(new i = 0; i < MAX_PLAYERS; i++)
  657.     {
  658.     if(EsAdministrador == false)
  659.     {
  660.         SendClientMessage(i, Azul, #[Anticheats] Usted no esta autorizado a usar el sistema Rcon);
  661.         break;
  662.     }
  663.     }
  664.     return 1;
  665. }
  666.  
  667. funcion OnVehicleDamageStatusUpdate(vehicleid, playerid)
  668. {
  669.     new Float:Vehicle_Health;
  670.     GetVehicleHealth(vehicleid, Vehicle_Health);
  671.     if(Vehicle_Health == VidaCoches[vehicleid])
  672.     {
  673.     VidaCoches[vehicleid] = Vehicle_Health;
  674.     return 1;
  675.     }
  676.     else
  677.     {
  678.     SendClientMessage(playerid, Azul, #[Anticheats] Hack vida coche);
  679.     return 1;
  680.     }
  681.  
  682.    
  683. }
  684.  
  685.  
  686. funcion OnPlayerUpdate(playerid)
  687. {
  688.     new Float:HP;
  689.     GetPlayerHealth(playerid, HP);
  690.     if(HP >=   VidaUsuario[playerid])
  691.     {
  692.         return 1;
  693.     }
  694.     else
  695.     {
  696.         SendClientMessage(playerid, Azul, #[Anticheats] Variable vida actualizada);
  697.         VidaPlayer(playerid, HP);
  698.         return 1;
  699.     }
  700.     new Float:Chaleco;
  701.     GetPlayerArmour(playerid, Chaleco);
  702.     if(Chaleco >=   ChalecoUsuario[playerid])
  703.     {
  704.         return 1;
  705.     }
  706.     else
  707.     {
  708.         SendClientMessage(playerid, Azul, #[Anticheats] Variable chaleco actualizada);
  709.         ChalecoPlayer(playerid, Chaleco);
  710.         return 1;
  711.     }
  712. }
  713.  
  714. funcion OnPlayerStreamIn(playerid, forplayerid)
  715. {
  716.     return 1;
  717. }
  718.  
  719. funcion OnPlayerStreamOut(playerid, forplayerid)
  720. {
  721.     return 1;
  722. }
  723.  
  724. funcion OnVehicleStreamIn(vehicleid, forplayerid)
  725. {
  726.     return 1;
  727. }
  728.  
  729. funcion OnVehicleStreamOut(vehicleid, forplayerid)
  730. {
  731.     return 1;
  732. }
  733.  
  734. funcion OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  735. {
  736.     return 1;
  737. }
  738.  
  739. funcion OnPlayerClickPlayer(playerid, clickedplayerid, source)
  740. {
  741.     return 1;
  742. }
  743.  
  744. /*      Funciones variadas      */
  745.  
  746. stock NombreEx(playerid)
  747. {
  748.     new string[24];
  749.     GetPlayerName(playerid,string,24);
  750.     new str[24];
  751.     strmid(str,string,0,strlen(string),24);
  752.     for(new i = 0; i < MAX_PLAYER_NAME; i++)
  753.     {
  754.         if (str[i] == '_') str[i] = ' ';
  755.     }
  756.     return str;
  757. }
  758.  
  759. funcion BorrarChat(playerid, lineas)
  760. {
  761.     if (IsPlayerConnected(playerid))
  762.     {
  763.         for(new i=0; i<lineas; i++)
  764.         {
  765.             SendClientMessage(playerid, -1, " ");
  766.         }
  767.     }
  768.     return 1;
  769. }
  770.  
  771.  
  772. stock ObtenerVelocidad(playerid)
  773. {
  774.     new Float:vX, Float:vY, Float:vZ, Float:Velocidad;
  775.     GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
  776.     Velocidad = floatmul(floatsqroot(floatadd(floatadd(floatpower(vX, 2), floatpower(vY, 2)),  floatpower(vZ, 2))), 100.0);
  777.     return floatround(floatdiv(Velocidad, 0.75), floatround_floor);
  778. }
  779.  
  780. //============================================================================//
  781. //                                                                            //
  782. //                                                                            //
  783. //                                                                            //
  784. //                                                                            //
  785. //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment