[Pedido] Anti Speed-Hack
#5

Quando o Player ultrapassa a velocidade definida, ele automaticamente diminui a velocidade para a velocidade definida,

Edite a velocidade mбxima em:
pawn Код:
#define VELOCIDADEMAX 200
Cуdigo
pawn Код:
#include <a_samp>
#define VELOCIDADEMAX 200
#pragma tabsize 0
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger){ SetTimer("VelocidadeCarro",10,true); return 1; } stock GetSpeedKM(playerid) { new Float:PosX, Float:PosY,Float:PosZ,Float:PlayerSpeedDistance; GetVehicleVelocity(GetPlayerVehicleID(playerid), PosX, PosY, PosZ);
PlayerSpeedDistance = floatmul(floatsqroot(floatadd(floatadd(floatpower(PosX, 2), floatpower(PosY, 2)),  floatpower(PosZ, 2))), 170.0);new spe = floatround(PlayerSpeedDistance * 1); return spe; }forward VelocidadeCarro(playerid);public VelocidadeCarro(playerid){if(IsPlayerInAnyVehicle(playerid)){
new Velocidade = GetSpeedKM(playerid);if(Velocidade > VELOCIDADEMAX){
//**************** FUNЗВO SE ESTIVE NA VELOCIDADE NВO PERMITIDA *********************************************
SendClientMessage(playerid,0xFFFFFFFF,"Nгo Pode Ultrapassar Velocidade");
SetarVelocidade(playerid);}}return 1;
//**************** FUNЗВO SE ESTIVE NA VELOCIDADE NВO PERMITIDA *********************************************
}stock SetarVelocidade(playerid){new Float:LADOA,Float:LADOB,Float:LADOC,Float:PlayerSpeedDistance;GetVehicleVelocity(GetPlayerVehicleID(playerid), LADOA, LADOB, LADOC);PlayerSpeedDistance = floatmul(floatsqroot(floatadd(floatadd(floatpower(LADOA, 2), floatpower(LADOB, 2)), floatpower(LADOC, 2))), 170.0);SetVehicleVelocity(GetPlayerVehicleID(playerid),-LADOA,-LADOB,-LADOC);floatround(PlayerSpeedDistance * 1);return 0;}
Para retirar a mensagem ao ultrapassar a velocidade, apague a linha:
pawn Код:
SendClientMessage(playerid,0xFFFFFFFF,"Nгo Pode Ultrapassar Velocidade");
Reply


Messages In This Thread
Anti Speed-Hack - by Valdemiro - 31.05.2014, 17:08
Re: Anti Speed-Hack - by MTCpyedroDN - 31.05.2014, 17:14
Re: Anti Speed-Hack - by Valdemiro - 31.05.2014, 17:20
Re: Anti Speed-Hack - by MTCpyedroDN - 31.05.2014, 17:30
Re: Anti Speed-Hack - by SpeakDS - 31.05.2014, 17:40
Re: Anti Speed-Hack - by lKoDlFuLLaNNo - 31.05.2014, 20:27

Forum Jump:


Users browsing this thread: 2 Guest(s)