Jump to content

[TUTORIAL] Anti heal car.


Джо

Recommended Posts

Salutare,dupa cum spune si titlul,am sa va fac un tutorial cum puteti sa va protejati de un hacker care foloseste executia healcar.(repair car)

Deci sa incepem,vom creea un

new VehicleHealth [ i ] = 999.0

in care [ i ] reprezinta toate vehiculele de pe server si 999.0 viata vehiculului,pentru siguranta eu o sa il pun pe 999.0

La OnGameModeInit vom pune un for si un timer:

for(new i = 1 ; i < MAX_VEHICLES ; i ++) VehicleHealth [ i ] = 1000.0 ;

SetTimer ( "Checkhpcar" , 1000 , true );

Dupa care vom creea un define,un new,un stock,un forward si un public.

#define PNSLS 9 // Definim cate PNS-uri sunt in LS/LV/SF
new Float : PnSC [ PNSLS ][ 3 ] = {// Luam locatiile PNS-urilor
{
720.2800 ,- 457.2757 , 16.3359 },
{-
1421.1030 , 2584.5122 , 55.8433 },
{-
99.8468 , 1118.1559 , 19.7417 },
{
2063.5869 ,- 1831.5231 , 13.5469 },
{-
2425.7590 , 1021.3259 , 50.3977 },
{
1974.2336 , 2162.3240 , 11.0703 },
{
487.1933 ,- 1738.4077 , 11.1189 },
{
1025.2147 ,- 1024.2096 , 32.1016 },
{-
1904.1440 , 283.5843 , 41.0469 }
};


stock IsPlayerAtPnSpray ( playerid ) // Creem un stock prin care verificam daca playerul este in PNS,si interiorul acestuia.
{
if( !
GetPlayerInterior ( playerid ) ) return false ;
for(new
i = 0 ; i < PNSLS ; i ++)
{
if(
IsPlayerInRangeOfPoint ( playerid , 15.0 , PnSC [ i ][ 0 ], PnSC [ i ][ 1 ], PnSC [ i ][ 2 ] )) { return true ; } // Verificam coordonatele PNS-ului.
}
return
false ;
}


forward Checkhpcar ();
public
Checkhpcar () // La fiecare secunda va fi verificata aceasta functie.
{
new
vehhl , vehid , str [ MAX_PLAYER_NAME ]; // Ia health-ul masinii initiale health-ul daca acesta foloseste hack si numele jucatorului.

for(new
i ; i < GetMaxPlayers (); i ++)
{

vehid = GetPlayerVehicleID ( i ); // Inregistreaza id-ul masinii.
if( !
vehid ) { continue; }
GetVehicleHealth ( vehid , vehhl ); // Inregistreaza cat mai are intial health masina.

if(
VehicleHealth [ vehid ] >= vehhl ) // Verifica daca s-a folosit health car-ul care este mai mare sau egal cu health-ul masinii initiale.
{

VehicleHealth [ vehid ] = vehhl ; // Aici daca hack heal car este egal cu heal-ul masinii initiale(nu s-a folosit health hack car) va merge mai departe.
continue;
}

if( !
IsPlayerAtPnSpray ( i ) ) // DACA PLAyerul nu  e in unul din PNS-uri
{

GetPlayerName ( i , str , sizeof str ); // Ii ia numele
format ( str , sizeof ( str ), "[Anticheat]%s si-a refacut masina!Tentativa de health car hack." , str); // Va trimite mesajul
SendClientMessageToAll ( COLOR_GREY , str ); // va trimite catre toti jucatorii ''vestea''
SetVehicleHealth ( vehid , VehicleHealth [ vehid ] ); //ii va reseta health-ul la masina la cat il avea.
}

VehicleHealth [ vehid ] = vehhl ;
}
}

Sper ca v-a ajutat cu ceva asta.

Cam asta folosesc eu si merge de fiecare data.

  • Upvote 1

 

 

Link to comment
Share on other sites

Frumos tutorialul bravo

Dar nu am inteles un lucrudaca ai alt interior si dai repair scapi de antihack?

Si ma mai gandesc cand intri in pns si tuning iti schimba camera oare puteai face daca  ai pozitiile camerei diferite ca sa nu mai faceai cu pns coordonate?

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.