Jump to content

[Pawno] - Protecție Anti-Checkpoint Teleport


KeNNyAdv
 Share

Recommended Posts

Acest cod simplu verifica atunci cand un jucator intra intr-un checkpoint timpul de la ultimul checkpoint intrat.
Daca acesta ajunge la el in mai putin de 2 secunde = > Are hack. (Mai mult la joburi).

Adăugăm înainte de toate:

new JobInterval[MAX_PLAYERS];
new HackDetected[MAX_PLAYERS];
Adăugați in codul sursă de unde se incepe slujba pentru a evita greșelile gen să fie detectat greșit.
JobInterval[playerid] = GetTickCount();

Adaugă la OnPlayerConnect.

HackDetected[playerid] = 0; 

Acum adăugați la OnPlayerCheckpoint unde aveți checkpoint respectiv pentru slujbă următorul cod inainte de tot.

VerificaSecundeCheckpoint(playerid); // Sa verifice in cat timp a ajuns jucatorul si sa aplice functia in caz ca are hack.
JobInterval[playerid] = GetTickCount(); // Se actualizează ultimul timp in care a ajuns la checkpoint.

Acum adăugați următorul cod sursă in josul codului dvs. și gata

stock VerificaSecundeCheckpoint(playerid)
{
    if(GetTickCount() - JobInterval[playerid] < 2000)          
    {
        if(HackDetected[playerid] != 0) return 1; // Pentru a evita spamming pe chat.
        HackDetected[playerid] = 1;
        //Aici faci ce vrei cu el.
    }
    return 1;
}

 

Edited by DreQusor
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • 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.