Advertisement
Guest User

Untitled

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