Guest User

CristianTdj

a guest
Jan 7th, 2010
2,319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new AutoFixTimer[MAX_PLAYERS];
  4.  
  5. forward InfiniteNitro();
  6.  
  7. public OnFilterScriptInit()
  8. {
  9. print(" \n-------------------------------------- ");
  10. print(" Nitro infinito y Autofix iniciando ");
  11. print(" --------------------------------------\n ");
  12.  
  13. SetTimer("InfiniteNitro",1000,1);
  14. SetTimer("Timer", 1000, true);
  15. return 1;
  16. }
  17. public OnGameModeInit()
  18. {
  19. print("Gamemode started!");
  20. return 1;
  21. }
  22.  
  23. public OnPlayerCommandText(playerid, cmdtext[])
  24. {
  25. if(!strcmp("/autofix", cmdtext, true))
  26. {
  27. if(AutoFixTimer[playerid])
  28. {
  29. KillTimer(AutoFixTimer[playerid]);
  30. AutoFixTimer[playerid] = false;
  31. return SendClientMessage(playerid, 0xFF0000FF, "Autofix desactivado");
  32. }
  33. else
  34. {
  35. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFF00FF, "Necesitas estar en un veh�culo para activar el autofix.");
  36. AutoFixTimer[playerid] = SetTimerEx("AutoFix", 1000, true, "i", playerid);
  37. return SendClientMessage(playerid, 0x61D911FF, "Autofix activado.");
  38. }
  39. }
  40. return 0;
  41. }
  42. public InfiniteNitro()
  43. {
  44. new vehicleid;
  45. for(new i=0;i<MAX_PLAYERS;i++)
  46. {
  47. if(IsPlayerConnected(i))
  48. {
  49. if(GetPlayerState(i)==2)
  50. {
  51. vehicleid=GetPlayerVehicleID(i);
  52. if(CheckVehicle(vehicleid))
  53. AddVehicleComponent(vehicleid,1010);
  54. }
  55. }
  56. }
  57. return 1;
  58. }
  59.  
  60. stock CheckVehicle(vehicleid)
  61. {
  62. #define MAX_INVALID_NOS_VEHICLES 13
  63.  
  64. new InvalidNOSVehicles[MAX_INVALID_NOS_VEHICLES] =
  65. {
  66. 522,481,441,468,448,446,513,521,510,430,520,476,463 // veh�culos no v�lidos para a�adir autonos
  67. };
  68.  
  69. for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
  70. {
  71. if(GetVehicleModel(vehicleid) == InvalidNOSVehicles[i]) return false;
  72. }
  73. return true;
  74. }
  75.  
  76. forward AutoFix(playerid);
  77. public AutoFix(playerid)
  78. {
  79. if(IsPlayerInAnyVehicle(playerid))
  80. {
  81. new vid = GetPlayerVehicleID(playerid), Float:health;
  82. GetVehicleHealth(vid , health);
  83. if(health < 500) SetVehicleHealth(vid , 1000.0);
  84. }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment