Jump to content

Recommended Posts

Posted (edited)

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.

 

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;
	}
	

Atenție nu știu dacă e bug doar la mine da unde este JobInterval[playerid] &lt; 2000) ar trebui sa fie JobInterval[playerid] < 2000) probabil o mică eroare la forum ?

 

 

 

Edited by S.Valentin (Hurdock)
  • Upvote 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.