Advertisement
Guest User

Gift from @Kazafka for being an As*hole

a guest
Feb 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. //anti car warp or wrap i allways forget lol, and also anti trollboss since it req to warp or wrap to players car.
  2.  
  3. #include <a_samp>
  4.  
  5. new bool:warp[MAX_PLAYERS];
  6.  
  7. public OnPlayerConnect(playerid)
  8. {
  9. warp[playerid] = false;
  10. return 1;
  11. }
  12.  
  13. public OnPlayerDisconnect(playerid, reason)
  14. {
  15. warp[playerid] = false;
  16. return 1;
  17. }
  18.  
  19. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  20. {
  21. warp[playerid] = true;
  22. SetTimerEx("swarp", 100, false, "d", playerid);
  23. return 1;
  24. }
  25.  
  26. public OnPlayerStateChange(playerid, newstate, oldstate)
  27. {
  28. if(newstate == 2 || newstate == 3)
  29. {
  30. if(warp[playerid])
  31. {
  32. ShowPlayerDialog(playerid, 2000, 0, "Detected", "Dont car warp/troll", "OK", "");
  33. }
  34. }
  35. return 1;
  36. }
  37.  
  38. forward swarp(playerid);
  39.  
  40. public swarp(playerid)
  41. {
  42. warp[playerid] = false;
  43. return 1;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement