Advertisement
Guest User

Untitled

a guest
Nov 15th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // - Blue Eclipse Troll, Anti slapper troll, /tr, etc.
  2. // IMPORTANT: Daca nu aveti un sistem de Fly, stergeti conditiile cu OnFly[playerid].
  3. // Creati o variabila:
  4. new Float:LastVelocity[MAX_PLAYERS][3];
  5. // Adaugati asta in gamemode-ul dvs, mai jos de new Float:LastVelocity[MAX_PLAYERS][3];
  6. TrollDetect(playerid, troll = 0)
  7. {
  8.     if(troll == 1)
  9.     {
  10.         new str[128], name[MAX_PLAYER_NAME+1];
  11.         GetPlayerName(playerid, name, sizeof name);
  12.         format(str, sizeof str, "Kick: %s has been kicked by AdmBot, reason: Troll (cheats)", name);
  13.         SendClientMessageToAll(COLOR_SANCTION, str);
  14.         Kick(playerid);
  15.         return 1;
  16.     }
  17.     if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  18.     {
  19.         if(OnFly[playerid] == false)
  20.         {
  21.             new Float:Velocity[3];
  22.             GetPlayerVelocity(playerid, Velocity[0], Velocity[1], Velocity[2]);
  23.             new Float:amount = Velocity[0]-LastVelocity[playerid][0];
  24.             new Float:amount2 = Velocity[1]-LastVelocity[playerid][1];
  25.             if(amount > 3.0 || amount < -4.0 || amount2  > 10.0 || amount2 < -10.0 || Velocity[2] == 0.100000)
  26.             {
  27.                 new str[128], name[MAX_PLAYER_NAME+1];
  28.                 GetPlayerName(playerid, name, sizeof name);
  29.                 format(str, sizeof str, "Kick: %s has been kicked by AdmBot, reason: Troll (cheats)", name);
  30.                 SendClientMessageToAll(COLOR_SANCTION, str);
  31.                 Kick(playerid);
  32.                 return 1;
  33.             }
  34.         }  
  35.     }
  36.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  37.     {
  38.         new Float:Velocity[3];
  39.         GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
  40.         if(Velocity[1] == -90.000000 && Velocity[2] == 0.100000)
  41.         {
  42.             new str[128], name[MAX_PLAYER_NAME+1];
  43.             GetPlayerName(playerid, name, sizeof name);
  44.             format(str, sizeof str, "Kick: %s has been kicked by AdmBot, reason: Troll (cheats)", name);
  45.             SendClientMessageToAll(COLOR_SANCTION, str);
  46.             Kick(playerid);
  47.             return 1;
  48.         }
  49.     }
  50.     if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) GetPlayerVelocity(playerid, LastVelocity[playerid][0],  LastVelocity[playerid][1],  LastVelocity[playerid][2]);
  51.     return 1;
  52. }
  53.  
  54. // Adaugati aceasta linie la inceputul OnPlayerEnterVehicle
  55. if(IsPlayerInAnyVehicle(playerid)) return TrollDetect(playerid, 1);
  56.  
  57. // Adaugati la OnPlayerUpdate:
  58. TrollDetect(playerid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement