Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new bool:PlayerFallSpeed[ MAX_PLAYERS ],
- Float:SpeedPos[ MAX_PLAYERS ][ 3 ];
- // -------------------- [ ONPLAYERCONNECT I RESET VARIJABLI ] --------
- PlayerFallSpeed[ playerid ] = false;
- // --------------------------- [ CALLBACKS ] --------------------
- forward OnPlayerFalla( playerid );
- public OnPlayerFalla( playerid ) {
- if( PlayerFallSpeed[ playerid ] ) return 1;
- SetTimerEx( "Reactivate", 8000, false, "i", playerid );
- PlayerFallSpeed[ playerid ] = true;
- return 1;
- }
- forward FallingChecker( playerid );
- public FallingChecker( playerid ) {
- new Float:Pozisn[ 4 ];
- if( IsPlayerConnected( playerid ) ) {
- GetPlayerPos( playerid, Pozisn[ 0 ], Pozisn[ 1 ], Pozisn[ 2 ] );
- Pozisn[ 3 ] = floatsqroot( ( Pozisn[ 0 ]-SpeedPos[ playerid ][ 0 ] * Pozisn[ 0 ]-SpeedPos[ playerid ][ 0 ] ) + ( Pozisn[ 1 ]-SpeedPos[ playerid ][ 1 ] * Pozisn[ 1 ]-SpeedPos[ playerid ][ 1 ] ) );
- if( Pozisn[ 3 ] < 10 && ( SpeedPos[ playerid ][ 2 ] - Pozisn[ 2 ] ) > 5 ) {
- OnPlayerFalla( playerid );
- }
- SpeedPos[ playerid ][ 0 ] = Pozisn[ 0 ];
- SpeedPos[ playerid ][ 1 ] = Pozisn[ 1 ];
- SpeedPos[ playerid ][ 2 ] = Pozisn[ 2 ];
- }
- return 1;
- }
- forward Reactivate( playerid );
- public Reactivate( playerid ) {
- PlayerFallSpeed[ playerid ] = false;
- return 1;
- }
- // ---------------------- [ DODAT U TAJMER OD 500MS ILI 1SEC ] ---------------------
- new string[128];
- new Float:Pos_x,Float:Pos_y,Float:Pos_z;
- new anim = GetPlayerAnimationIndex(id);
- GetPlayerVelocity(id,Pos_x,Pos_y,Pos_z);
- FallingChecker(id);
- if(Pos_x <= -0.800000 || Pos_y <= -0.800000 || Pos_z <= -0.800000 && anim == 1008)
- {
- new tmpcar = GetPlayerVehicleID(id);
- if(!VoziloJeAvion(tmpcar) && GetPlayerSurfingVehicleID(id) == INVALID_VEHICLE_ID && !PlayerFallSpeed[ id ])
- {
- format(string, 256, "{D5A658}(AntiCheat) {D55858}%s (%d) koristi airbreak hack, provjeri ga!",GetPlayerNameEx(id), id);
- ABroadCast(SIVA,string,1); //stavi svoje, znaci da je detektovan
- }
- }
Add Comment
Please, Sign In to add comment