Jump to content

Anti-Speed hack


MajkX

Recommended Posts

Je to moj prvy tutorial :) Vyskusal som ho , bugy ani Errory to nehadze takze tu to je :

 

Hore pod Includy :

 

new Float:x[256],Float:y[256],Float:z[256];//Nezbytne pre chod Scriptu

new Float:xx[256],Float:yy[256],Float:zz[256];// Taktiez nezbytne :d

new speed[256]; // Premenna pre Speed

new hSpeed[256];// Premenna pre hSpeed

forward CheckS();

forward AnSpeed();

 

 

Do OnPlayerConnect :

 

 

speed[playerid] = 0; // Ked sa hrac pripjoji nastavi mu to Speed na 0

 

 

 

do OnPlayerDeath :

 

 

speed[playerid] = 0; // Ked hrac zomrie , nastavi mu Speed na 0

 

 

 

do OnPlayerEnterVehicle :

 

 

speed[playerid] = 1 // nastavi hracovi premennu Speed na 1

 

 

 

do OnPlayerExitVehicle :

 

 

speed[playerid] = 0; // nastavi hracovi premennu Speed na 0

 

 

 

a toto Uplne dole do modu :

 

 

public CheckS() // Public pre citanie udajov z rychlosti

{

for (new i=0;i<40;i++)

if (IsPlayerConnected(i) && speed == 1)

{

if (!IsPlayerAdmin(i)) /

{

if (GetVehicleModel(GetPlayerVehicleID(i)) != 520 && GetVehicleModel(GetPlayerVehicleID(i)) != 519)

GetPlayerPos(i,x,y,z);

hSpeed = 1;

SetTimer("AnSpeed",1000,0);

}

}

}

}

public AnSpeed()

{

for (new i=0;i<40;i++)

if (IsPlayerConnected(i) && hSpeed == 1)

{

GetPlayerPos(i,xx,yy,zz);

if (xx>x+75 || yy>y+75 || xx

{

GetPlayerName(i, pName, MAX_PLAYER_NAME);

format(string, sizeof(string), "Hráe %s bol pozitivni na Speed-Hack!!", pName);

SendClientMessageToAll(COLOR_RED,string);

}

}

}

 

 

 

 

Dufam ze vam TuT pomohol :d je to moj prvy tut , nemali by tu byt errory :)

Link to comment
Share on other sites

5/10 má to chybu

je tam použitá funkce OnPlayerEnterVehicle a ta se spustí když hráč je u auta a stiskne ENTER a co když by se pak ještě hnul.... proto je lepčí použít fci OnPlayerStateChange

Link to comment
Share on other sites

Jasně ty péroslave, tvůj prvý TUT? :d:D:D. Dej si facku!

 

http://pawnobox.net/smf2/index.php?topic=4549.0

Mmmm.. vůbec to není celé zkopírované z pawbnoboxu..mmmm... vůbec sem ho nenapsal já.. vůbec ho nedoporučuji používat protože je docela lamsky/nepoužitelně/ a zastarale zapsán (tenkrát to byl můj první tut a vůbec jeden z prvních scriptů, sem byl rád že to funguje :d:D)

Link to comment
Share on other sites

no podle mne to neni 100% kontroluje to pokud se hrac behem 1 vteriny pohne o 75 metru no s0beit je propracovanejsi myslim ze ma mensi hodnoty i kdyz sou 2 druhy speedhacku..

no neskousel sem ale podle mne to odhali tak 33%

Link to comment
Share on other sites

tet sem udelal antispeedhack a docela i funguje

 

stock GetVehicleType(model)
{
if(model > 399 && model < 613)
{
	switch(model)
	{
		case 590,569,537,538,570,449,592,577,511,548,512,593, 425,417,487,553,488,497,563,476,447,519,460,469,513,520: return 0;
	}
}
return 1;
}

stock GetPlayerSpeed(playerid,bool:kmh)
{
   new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
   if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
   rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
   return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
new AntiCheatVyska[MAX_PLAYERS];
new ACRychlost[MAX_PLAYERS];
forward Tachometr();
public Tachometr()
{
for(new i;i	{
	if(IsPlayerConnected(i))
	{
		if(IsPlayerInAnyVehicle(i))
		{
			new r = GetPlayerSpeed(i,true);
			new Float:x,Float:y,Float:z;
			GetPlayerPos(i,x,y,z);
		    if(r-ACRychlost[i] > 70 || r > 282)//rozdilna rychlost 70 max rychlost 282
			{
				if(GetVehicleType(a))//vyjimka letadel a vlaku a tamvaje
				{
				    if(AntiCheatVyska[i]-z < 50)//pokud nepada volnym padem
					{
					    format(string,sizeof(string),"Hráč %s má speedhack",Jmeno(i));
					    SendClientMessageToAll(0xFFFFFFAA,string);
					}
				}
			}
AntiCheatVyska[i] = z;
               ACRychlost[i] = r;
		}
	}
}
return 1;
}

Link to comment
Share on other sites

  • 2 weeks later...

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