Peršokti į turinį

Anticheat


Recommended Posts

Sveiki, kas čia atsakingas už greitį, nes pvz. sukuriau GT režimą, o kai įsibeginėja, jį stopiną.

    //Anti Speed
    new vehicleid = GetPlayerVehicleID(playerid);
    new model = GetVehicleModel(vehicleid);
    if(model != 417 && model != 425 && model != 447 && model != 469 && model != 476 && model != 497 && model != 511 && model != 512 && model != 513 && model != 519 && model != 520 && model != 548 && model != 553 && model != 563)
      {
        if(IsPlayerConnected(playerid))
         {
            if(IsPlayerInAnyVehicle(playerid))
            {
                 new Float:vX, Float:vY, Float:vZ, Float:Speed;
                  GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
                  Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(vX, 2), floatpower(vY, 2)),  floatpower(vZ, 2))), 200.0);
                if(playerid, Speed >= 300.0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                 {
                      new msg[102];
                    format(msg,sizeof(msg),"[Àäìèí×àò] [Ñåðâåð]: Èãðîê ïðåâûøàåò ñêîðîñòü: /look {FF9900}%s",GautiVarda(playerid));
                    SendMessageToAdmin(0xAA3333AA, msg);
                     TogglePlayerControllable(playerid,false);
                     SetTimerEx("kmh", 3000, false, "kmh", playerid);
                }
            }
        }
    }
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        static s_iVehicle;
        if(g_fSpeedCap[playerid] != 0.0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            s_iVehicle = GetPlayerVehicleID(playerid);
               if(s_iVehicle)
               {
                      static Float: s_fX, Float: s_fY, Float: s_fZ, Float: s_fVX, Float: s_fVY, Float: s_fVZ;
                      GetVehiclePos(s_iVehicle, s_fX, s_fY, s_fZ);
                      GetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ);
                      if(!IsPlayerInRangeOfPoint(playerid, g_fSpeedCap[playerid] + 0.05, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ))
                      {
                          static Float: s_fLength;
                          s_fLength = floatsqroot((s_fVX * s_fVX) + (s_fVY * s_fVY) + (s_fVZ * s_fVZ));
                          s_fVX = (s_fVX / s_fLength) * g_fSpeedCap[playerid];
                          s_fVY = (s_fVY / s_fLength) * g_fSpeedCap[playerid];
                          s_fVZ = (s_fVZ / s_fLength) * g_fSpeedCap[playerid];
                          if(s_iVehicle)
                          {
                              SetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ);
                          }
                      }
               }
        }
        SpeedMeterUpdate(playerid, GetPlayerVehicleID(playerid));
    }
    return 1;
}

Ačiū, +REP.

Nuoroda į komentarą
Dalintis per kitą puslapį

(redaguota)

Rodyk ką pakeitei. Tuo pačiu dar ir GT parodyk.

    //Anti Speed

    new vehicleid = GetPlayerVehicleID(playerid);

    new model = GetVehicleModel(vehicleid);

    if(model != 417 && model != 425 && model != 447 && model != 469 && model != 476 && model != 497 && model != 511 && model != 512 && model != 513 && model != 519 && model != 520 && model != 548 && model != 553 && model != 563)

      {

        if(IsPlayerConnected(playerid))

         {

            if(IsPlayerInAnyVehicle(playerid))

            {

                 new Float:vX, Float:vY, Float:vZ, Float:Speed;

                  GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);

                  Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(vX, 2), floatpower(vY, 2)),  floatpower(vZ, 2))), 200.0);

                if(playerid, Speed >= 20000.0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

                 {

                      new msg[102];

                    format(msg,sizeof(msg),"[Àäìèí×àò] [Ñåðâåð]: Èãðîê ïðåâûøàåò ñêîðîñòü: /look {FF9900}%s",GautiVarda(playerid));

                    SendMessageToAdmin(0xAA3333AA, msg);

                     TogglePlayerControllable(playerid,false);

                     SetTimerEx("kmh", 3000, false, "kmh", playerid);

                }

            }

        }

    }

    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

    {

        static s_iVehicle;

        if(g_fSpeedCap[playerid] != 0.0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

        {

            s_iVehicle = GetPlayerVehicleID(playerid);

               if(s_iVehicle)

               {

                      static Float: s_fX, Float: s_fY, Float: s_fZ, Float: s_fVX, Float: s_fVY, Float: s_fVZ;

                      GetVehiclePos(s_iVehicle, s_fX, s_fY, s_fZ);

                      GetVehicleVelocity(s_iVehicle, s_fVX, s_fVY, s_fVZ);

                      if(!IsPlayerInRangeOfPoint(playerid, g_fSpeedCap[playerid] + 0.05, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ))

                      {

                          static Float: s_fLength;

                          s_fLength = floatsqroot((s_fVX * s_fVX) + (s_fVY * s_fVY) + (s_fVZ * s_fVZ));

                          s_fVX = (s_fVX / s_fLength) * g_fSpeedCap[playerid];

                          s_fVY = (s_fVY / s_fLength) * g_fSpeedCap[playerid];

                          s_fVZ = (s_fVZ / s_fLength) * g_fSpeedCap[playerid];

                          if(s_iVehicle)

                      }

               }

        }

        SpeedMeterUpdate(playerid, GetPlayerVehicleID(playerid));

    }

    return 1;

}

O GT:

#include <a_samp>

new

    Text:spidometras[ MAX_VEHICLES ],

    Text:SPEEDOS[ MAX_VEHICLES ],

    bool:ShiftInfo[ MAX_VEHICLES ] = true,

    ShiftTimer[ MAX_VEHICLES ],

    bool:GTRezimas[ MAX_VEHICLES ]

;

public OnFilterScriptInit()

{

    print("\n--------------------------------------");

    print(" Blank Filterscript by your name here");

    print("--------------------------------------\n");

    return 1;

}

public OnFilterScriptExit()

{

    return 1;

}

public OnPlayerConnect( playerid )

{

    spidometras[ playerid ] = TextDrawCreate( 285.000000, 390.000000, "Speedometer" );

    TextDrawFont( spidometras[ playerid ], 3 );

    TextDrawLetterSize( spidometras[ playerid ], 0.390000, 0.899999 );

    TextDrawColor( spidometras[ playerid ], -1 );

    TextDrawSetOutline( spidometras[ playerid ], 1 );

    TextDrawSetProportional( spidometras[ playerid ], 1 );

    TextDrawTextSize( spidometras[ playerid ], 405.000000, 0.000000 );

 

    SPEEDOS[ playerid ] = TextDrawCreate( 254.000000, 389.000000, " " );

    TextDrawBackgroundColor( SPEEDOS[ playerid ], 0x000000bb );

    TextDrawFont( SPEEDOS[ playerid ], 2 );

    TextDrawLetterSize( SPEEDOS[ playerid ], 0.2300, 0.8999 );

    TextDrawColor( SPEEDOS[ playerid ], -1 );

    TextDrawSetOutline( SPEEDOS[ playerid ], 1 );

    TextDrawSetProportional( SPEEDOS[ playerid ], 1 );

    TextDrawUseBox( SPEEDOS[ playerid ], 1);

    TextDrawBoxColor( SPEEDOS[ playerid ], 0x00000055 );

    TextDrawTextSize( SPEEDOS[ playerid ], 405.000000, 0.000000 );

 

    ShiftInfo[ playerid ] = ( ShiftInfo[ playerid ] == false ) ? ( true ) : ( true );

    ShiftTimer[ playerid ] = SetTimerEx("Speedometer", 200, true, "e", playerid );

    return 1;

}

public OnPlayerDisconnect( playerid, reason )

{

    if( IsPlayerInAnyVehicle( playerid ) )

    {

        if( GTRezimas[ GetPlayerVehicleID( playerid ) ] )

        {

            GTRezimas[ GetPlayerVehicleID( playerid ) ] = false;

        }

    }

    return 1;

}

public OnPlayerCommandText( playerid, cmdtext[ ] )

{

    if( !strcmp( cmdtext, "/gtr", true ) )

    {

        if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, 0xFF0000FF, "Âû íå RCON àäìèíèñòðàòîð!" );

        if( !IsPlayerInAnyVehicle( playerid ) ) return SendClientMessage( playerid, 0xFF0000FF, "Äîëæíû áûòü â Ò.Ñ.!" );

        new

            masina = GetPlayerVehicleID( playerid )

        ;

        if( GTRezimas[ masina ] )

        {

            SendClientMessage( playerid, 0xFFFF00FF, "GT ðåæèì ýòîé ìàøèíå âêëþ÷åí!" );

            GTRezimas[ masina ] = false;

        }

        else

        {

            SendClientMessage( playerid, 0xFFFF00FF, "GT ðåæèì ýòîé ìàøèíå âûêëþ÷åí!" );

            GTRezimas[ masina ] = true;

        }

        return 1;

    }

    return 0;

}

public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )

{

    if( IsPlayerInAnyVehicle( playerid ) && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )

    {

        new

            masina = GetPlayerVehicleID( playerid )

        ;

        if( GTRezimas[ masina ] )

        {

            if( newkeys & KEY_ANALOG_UP ) // Pagreitinimas.

            {

                if( GetVehicleSpeed( masina ) < 5000 )

                {

                    new

                        Float:vehx,

                        Float:vehy,

                        Float:vehz

                    ;

                    GetVehicleVelocity( masina, vehx, vehy, vehz );

                    SetVehicleVelocity( masina, vehx * 1.4, vehy * 1.4, vehz * 1.4 );

                }

            }

            if( newkeys & KEY_ANALOG_DOWN ) // Sulëtinimas.

            {

                new

                    Float:vehx,

                    Float:vehy,

                    Float:vehz

                ;

                GetVehicleVelocity( masina, vehx, vehy, vehz );

                SetVehicleVelocity( masina, vehx / 1.4, vehy / 1.4, vehz / 1.4 );

            }

            if( newkeys & KEY_ANALOG_LEFT ) // Pagydymas.

            {

                RepairVehicle( masina );

                SetVehicleHealth( masina, 1000 );

                SetPlayerHealth( playerid, 100 );

                SetPlayerArmour( playerid, 100 );

            }

            if( newkeys & KEY_ANALOG_RIGHT ) // Apvertimas.

            {

                new

                    Float:x,

                    Float:y,

                    Float:z,

                    Float:angle

                ;

                GetVehiclePos( masina, x, y, z );

                GetVehicleZAngle( masina, angle );

                SetVehiclePos( masina, x, y, z + 1 );

                SetVehicleZAngle( masina, angle );

            }

            if( newkeys & KEY_CROUCH ) // Paðokimas.

            {

                new

                    Float:vehx,

                    Float:vehy,

                    Float:vehz

                ;

                GetVehicleVelocity( masina, vehx, vehy, vehz );

                SetVehicleVelocity( masina, vehx, vehy, vehz + 0.4 );

            }

        }

    }

    return 1;

}

forward Speedometer( playerid );

public Speedometer( playerid )

{

    new vehicleid, speed_string[256];

    vehicleid = GetPlayerVehicleID(playerid);

    /*if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

    {*/

    if( !IsPlayerInAnyVehicle( playerid ) )

    {

        TextDrawHideForPlayer(playerid, spidometras[playerid]);

        TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

        return 1;

    }

 

    new VehicleNames[212][] = {

    "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",

    "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",

    "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",

    "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",

    "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",

    "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",

    "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",

    "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",

    "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",

    "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",

    "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",

    "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",

    "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",

    "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",

    "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",

    "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",

    "Stair Trailer","Boxville","Farm Plow","Utility Trailer" };

 

    new masinosbukle[10];

    new Float:health;

    GetVehicleHealth(vehicleid, health);

    if(health >900)

    {

        format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

    }

    else if(health >800)

    {

           format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

    }

    else if(health >700)

    {

           format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

    }

    else if(health >600)

    {

           format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

    }

    else if(health >500)

    {

           format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

    }

    else if(health >400)

    {

           format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

    }

    else if(health >300)

    {

           format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

    }

    else if(health >200)

    {

           format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

    }

    else if(health >100)

    {

           format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

    }

    else if(health <100)

    {

        format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

    }

 

 

    new model = GetVehicleModel(vehicleid);

    if(ShiftInfo[playerid] == true)

    {

        format(speed_string,156,"~n~~n~  ~y~Car: ~w~%s %s~n~  ~g~Speed: ~w~%i Km/h~n~  ~r~Heal: ~w~%s~n~  ~b~Fuel: ~w~150L", VehicleNames[model-400], ( GTRezimas[ vehicleid ] ) ? ( "~r~GT" ) : ( "" ), GetVehicleSpeed( vehicleid ), masinosbukle );

           TextDrawSetString(SPEEDOS[playerid], speed_string);

        TextDrawShowForPlayer(playerid, spidometras[playerid]);

        TextDrawShowForPlayer(playerid, SPEEDOS[playerid]);

    }else{

         TextDrawHideForPlayer(playerid, spidometras[playerid]);

        TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

    }

    /*}else{

         TextDrawHideForPlayer(playerid, spidometras[playerid]);

        TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

    }*/

    return 1;

}

stock GetVehicleSpeed( vehicleid )

{

    new

        Float:Speed[ 4 ]

    ;

    GetVehicleVelocity( vehicleid, Speed[ 0 ], Speed[ 1 ], Speed[ 2 ] );

    Speed[ 3 ] = floatsqroot( floatpower( floatabs( Speed[ 0 ] ), 2.0 ) + floatpower( floatabs( Speed[ 1 ] ), 2.0 ) + floatpower( floatabs( Speed[ 2 ] ), 2.0 ) ) * 100.3;

     return floatround( Speed[ 3 ] ) * 2;

}

Redaguota , nario Valix_Lmike
Nuoroda į komentarą
Dalintis per kitą puslapį

Svečias
Ši tema yra užrakinta.
  • Šiame puslapyje naršo:   0 nariai

    Nėra registruotų narių peržiūrinčių šį forumą.




×
×
  • Sukurti naują...