Guest User

Tow Vehicle

a guest
Jun 20th, 2012
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. /* A Simple Tow Car Style Made by Gaurav_Rawat
  2. I hope you like it
  3. Please rep me if you like my work :)*/
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #define COLOR_GREY 0xAFAFAFFF
  8. #if defined FILTERSCRIPT
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n--------------------------------------");
  13. print(" Tow Any Car Anywhere");
  14. print("--------------------------------------\n");
  15. return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20. return 1;
  21. }
  22.  
  23. #else
  24.  
  25. main()
  26. {
  27. print("\n----------------------------------");
  28. print(" Tow Any Car Anywhere FS by Gaurav_Rawat");
  29. print("----------------------------------\n");
  30. }
  31.  
  32. #endif
  33.  
  34. public OnPlayerConnect(playerid)
  35. {
  36. SendClientMessageToAll(COLOR_GREY,"This Server uses Tow Vehicle by Gaurav_Rawat");
  37. return 1;
  38. }
  39. CMD:tow(playerid, params[])
  40. {
  41. if (IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) SendClientMessage(playerid, COLOR_GREY, "You are already towing a vehicle.");
  42. new Float:PPPX,Float:PPPY,Float:PPPZ;
  43. GetPlayerPos(playerid,PPPX,PPPY,PPPZ);
  44. new Float:VVVX,Float:VVVY,Float:VVVZ;
  45. new Found=0;
  46. new vid=0;
  47. while((vid<MAX_VEHICLES)&&(!Found))
  48. {
  49. vid++;
  50. GetVehiclePos(vid,VVVX,VVVY,VVVZ);
  51. if ((floatabs(PPPX-VVVX)<7.0)&&(floatabs(PPPY-VVVY)<7.0)&&(floatabs(PPPZ-VVVZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
  52. {
  53. Found=1;
  54. AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
  55. }
  56.  
  57. }
  58. if (!Found)
  59. {
  60. SendClientMessage(playerid,COLOR_GREY,"There is no vehicle in range.");
  61. }
  62. return 1;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment