impound.inc 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. CMD:impound( playerid, params[] ) {
  2. if( PlayerInfo[playerid][pMember] != 1 ) {
  3. return SendClientMessage( playerid, COLOR_GREY, "You must be a police officer to use this command." );
  4. }
  5. if( !IsPlayerInRangeOfPoint( playerid, 10.0, 2259.2510,-2138.4514,13.5469 ) ) {
  6. return SendClientMessage( playerid, COLOR_GREY, "You are not by the impound point at the Los Santos Impound Yard." );
  7. }
  8. new Float: vpos[3], slot;
  9. for( new i; i <= GetPlayerPoolSize(); i++ ) {
  10. slot = GetPlayerSpawnedVehicleSlot( i );
  11. if( slot < 0 ) continue;
  12. #define veh(%1) PlayerVehicles[i][slot][pv%1]
  13. GetVehiclePos( veh(ID), vpos[0], vpos[1], vpos[2] );
  14. //Is player in range of the vehicle, and impound point?
  15. if( IsPlayerInRangeOfPoint( playerid, 5.0, vpos[0], vpos[1], vpos[2] ) ) {
  16. //set the vehicle to impounded
  17. veh(impounded) = 1;
  18. //reset trunk info
  19. veh(Gun1) = 0;
  20. veh(Gun2) = 0;
  21. veh(Pot) = 0;
  22. veh(Crack) = 0;
  23. veh(Armor) = 0.0;
  24. destroyPlayerVehicle( i, slot ); //adjust this, playerid = owner playerid not this
  25. SendClientMessage( playerid, COLOR_LIGHTBLUE, "You have successfully impounded the vehicle." );
  26. return 1;
  27. }
  28. #undef veh
  29. }
  30. return 1;
  31. }
  32. CMD:impoundradius( playerid, params[] ) {
  33. if( PlayerInfo[playerid][pAdmin] < 2 ) {
  34. return 1;
  35. }
  36. new radius;
  37. if( sscanf( params, "d", radius ) ) {
  38. return SendClientMessage( playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /impoundradius [radius(decimal)]");
  39. }
  40. if( radius > 15 || radius < 1 ) {
  41. return SendClientMessage( playerid, COLOR_GREY, "The radius must be less than 15, and greater than 0." );
  42. }
  43. new Float: vpos[3], slot;
  44. for( new i; i <= GetPlayerPoolSize(); i++ ) {
  45. slot = GetPlayerSpawnedVehicleSlot( i );
  46. if( slot < 0 ) continue;
  47. #define veh(%1) PlayerVehicles[i][slot][pv%1]
  48. GetVehiclePos( veh(ID), vpos[0], vpos[1], vpos[2] );
  49. //Is player in range of the vehicle, and impound point?
  50. if( IsPlayerInRangeOfPoint( playerid, float(radius), vpos[0], vpos[1], vpos[2] ) ) {
  51. //set the vehicle to impounded
  52. veh(impounded) = 1;
  53. //reset trunk info
  54. veh(Gun1) = 0;
  55. veh(Gun2) = 0;
  56. veh(Pot) = 0;
  57. veh(Crack) = 0;
  58. veh(Armor) = 0.0;
  59. destroyPlayerVehicle( i, slot ); //adjust this, playerid = owner playerid not this
  60. }
  61. #undef veh
  62. }
  63. SendClientMessage( playerid, COLOR_LIGHTBLUE, "You have successfully impounded the vehicles." );
  64. return 1;
  65. }
  66. CMD:release( playerid, params[] ) {
  67. new slot, confirm[128];
  68. if( !IsPlayerInRangeOfPoint( playerid, 3.0, -2033.2562,-117.4913,1035.1719 ) ) {
  69. return SendClientMessage( playerid, COLOR_GREY, "You must be by the release point at the Impound Yard." );
  70. }
  71. if( sscanf( params, "is[128]", slot, confirm ) ) {
  72. SendClientMessage( playerid, COLOR_WHITE, "It will cost $50,000 to release your vehicle." );
  73. return SendClientMessage( playerid, COLOR_LIGHTBLUE, "{00BFFF}Usage:{FFFFFF} /release [car slot] [confirm] - to confirm and release your vehicle." );
  74. }
  75. if( slot > PlayerInfo[playerid][pMaxCarSlots] || slot < 1 ) {
  76. return SendClientMessage( playerid, COLOR_GREY, "You must enter a valid car slot (between 1 and 3-4). HINT: see /myvehicles." );
  77. }
  78. if( PlayerInfo[playerid][pCash] < 50000 ) {
  79. return SendClientMessage( playerid, COLOR_GREY, "You cannot afford to release your vehicle." );
  80. }
  81. slot--;
  82. #define veh(%1) PlayerVehicles[playerid][slot][pv%1]
  83. if( veh(impounded ) ) {
  84. GiveMoney( playerid, -50000 );
  85. veh(impounded) = 0;
  86. spawnPlayerVehicle( playerid, slot );
  87. SetVehiclePos( veh(ID), 2274.7224,-2127.9663,13.7202 );
  88. SetVehicleZAngle( veh(ID), 45.0 );
  89. SendClientMessage( playerid, COLOR_LIGHTBLUE, "You have paid the pound to release your vehicle. Find your vehicle on the grass by the fence." );
  90. return 1;
  91. }
  92. SendClientMessage( playerid, COLOR_GREY, "This vehicle is not impounded." );
  93. #undef veh
  94. return 1;
  95. }