Advertisement
Guest User

Untitled

a guest
Feb 7th, 2017
2,591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <YSI\y_hooks>
  2.  
  3. new const Float:paynspray[][] =
  4. {
  5.     {1025.05, -1024.23, 32.1}, // LS Temple
  6.     {487.68, -1740.87, 11.13}, // LS Santa Maria
  7.     {-1420.73, 2583.37, 55.56}, // El Quebrados
  8.     {-1904.39, 284.97, 40.75}, // Wang Cars
  9.     {-2425.91, 1022.33, 50.10}, // Juniper Hill
  10.     {1975.60, 2162.16, 10.77}, // LV Redsands
  11.     {2065.38, -1831.51, 13.25}, // Idlewood
  12.     {-99.55, 1118.36, 19.44}, // Fort Carson
  13.     {721.07, -455.94, 16.04}, // Dillimore
  14.     {2393.74, 1493.01, 10.52} // LV Unused (Pyramid)
  15. };
  16.  
  17. Hook:paynspray_OnPlayerUpdate(playerid)
  18. {
  19.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  20.     {
  21.         new Float:vHealth;
  22.         GetVehicleHealth(GetPlayerVehicleID(playerid), vHealth);
  23.         if(vHealth == 1000)
  24.         {
  25.             SetVehicleHealth(GetPlayerVehicleID(playerid), 999);
  26.             for(new i = sizeof(paynspray) - 1; i != -1; --i)
  27.             {
  28.                 if(IsPlayerInRangeOfPoint(playerid, 10.0, paynspray[i][0], paynspray[i][1], paynspray[i][2]))
  29.                 {
  30.                     CallRemoteFunction("OnVehicleRespray", "iiii", playerid, GetPlayerVehicleID(playerid), -1, -1);
  31.                     return 1;
  32.                 }
  33.             }
  34.         }
  35.     }
  36.     return 1;
  37. }
  38.  
  39. stock paynspray_CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay)
  40. {
  41.     new vid = CreateVehicle(vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
  42.     SetVehicleHealth(vid, 999);
  43.     return vid;
  44. }
  45.  
  46. #if defined _ALS_CreateVehicle
  47.     #undef CreateVehicle
  48. #else
  49.     #define _ALS_CreateVehicle
  50. #endif
  51. #define CreateVehicle paynspray_CreateVehicle
  52.  
  53. stock paynspray_AddStaticVehicleEx(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay)
  54. {
  55.     new vid = AddStaticVehicleEx(vehicletype, x, y, z, rotation, color1, color2, respawn_delay);
  56.     SetVehicleHealth(vid, 999);
  57.     return vid;
  58. }
  59.  
  60. #if defined _ALS_AddStaticVehicleEx
  61.     #undef AddStaticVehicleEx
  62. #else
  63.     #define _ALS_AddStaticVehicleEx
  64. #endif
  65. #define AddStaticVehicleEx paynspray_AddStaticVehicleEx
  66.  
  67. stock paynspray_AddStaticVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2)
  68. {
  69.     new vid = AddStaticVehicle(vehicletype, x, y, z, rotation, color1, color2);
  70.     SetVehicleHealth(vid, 999);
  71.     return vid;
  72. }
  73.  
  74. #if defined _ALS_AddStaticVehicle
  75.     #undef AddStaticVehicle
  76. #else
  77.     #define _ALS_AddStaticVehicle
  78. #endif
  79. #define AddStaticVehicle paynspray_AddStaticVehicle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement