Advertisement
Nazariq

Untitled

Jun 3rd, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.73 KB | None | 0 0
  1. #include <foreach> // by Y_Less
  2.  
  3. new Iterator:valid_vehicles<MAX_VEHICLES>;
  4.  
  5. #define forveh(%0) foreach (new %0 : valid_vehicles)
  6.  
  7. stock Forveh_CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
  8. {
  9.     new vehid = CreateVehicle(modelid, x, y, z,angle, color1, color2, respawn_delay);
  10.     Iter_Add(valid_vehicles, vehid);
  11.     return vehid;
  12. }
  13.  
  14. #if defined _ALS_CreateVehicle
  15.     #undef CreateVehicle
  16. #else
  17.     #define _ALS_CreateVehicle
  18. #endif
  19. #define CreateVehicle Forveh_CreateVehicle
  20.  
  21. stock Forveh_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2)
  22. {
  23.     new vehid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2);
  24.     Iter_Add(valid_vehicles, vehid);
  25.     return vehid;
  26. }
  27.  
  28. #if defined _ALS_AddStaticVehicle
  29.     #undef AddStaticVehicle
  30. #else
  31.     #define _ALS_AddStaticVehicle
  32. #endif
  33. #define AddStaticVehicle Forveh_AddStaticVehicle
  34.  
  35. stock Forveh_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, respawn_delay)
  36. {
  37.     new vehid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2,respawn_delay);
  38.     Iter_Add(valid_vehicles, vehid);
  39.     return vehid;
  40. }
  41.  
  42. #if defined _ALS_AddStaticVehicleEx
  43.     #undef AddStaticVehicleEx
  44. #else
  45.     #define _ALS_AddStaticVehicleEx
  46. #endif
  47. #define AddStaticVehicleEx Forveh_AddStaticVehicleEx
  48.  
  49. stock Forveh_DestroyVehicle(vehicleid)
  50. {
  51.     if(Iter_Contains(valid_vehicles, vehicleid))
  52.         Iter_Remove(valid_vehicles, vehicleid);
  53.     return DestroyVehicle(vehicleid);
  54. }
  55. #if defined _ALS_DestroyVehicle
  56.     #undef DestroyVehicle
  57. #else
  58.     #define _ALS_DestroyVehicle
  59. #endif
  60. #define DestroyVehicle Forveh_DestroyVehicle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement