If players goes 300 km/h = BAN
#1

Well,i need help.

I need to make this:

If player goes more than 300 km/h with a vehicle,they got banned for Speedhack.

And ofc,i need ho exclude: Hydra/Hunter/Shaml and all helis/planes.

Thanks.
Reply
#2

Use a stock.
Reply
#3

no planes can go 300 rlly. but 300 is speedhack, i use it.
pawn Код:
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
        {
            new Float:speed;
            speed = GetPlayerSpeed(i, false);
            if(speed > 301)
            {
            }
            speed = GetPlayerSpeed(i, true);
            if(speed > 301)
            {
            }
        }
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);
}
if getplayerspeed = true its mph if its false its kmph
Reply
#4

I know you'll find this fairly irrelevant to your question, but have you taken lag spikes into consideration?

And this tutorial should be able to help you reach your destination.
Reply
#5

Thanks The_Gangstas,but where is the Ban function?

iFriSki

Ok i will look in it.Thanks.
Reply
#6

You left me no choice.

pawn Код:
stock GetPlayerSpeed(playerid) //MPH
{ //credits to Victious..
        new Float:x,Float:y,Float:z,string[128];
        GetVehiclePos(veh,x,y,z);
        new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
        GetVehicleVelocity(veh, speed_x, speed_y, speed_z);
        final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*85.4166672; // 136.666667 = kmph  // 85.4166672= mph
        final_speed_int = floatround(final_speed,floatround_round);
        format(string,sizeof(string),"Speed: %i MPH",final_speed_int,2000);
        SendClientMessage(playerid,COLOR_LIGHTGREEN,string);
    return 1;
}

There. Is a variable so hard to code?

//Excuse my indentation, I had to delete some stuff that you wouldn't need.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)