Guest User

Untitled

a guest
Mar 4th, 2012
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. // tal332255 - Tal Peretz - made by
  2.  
  3. #include <a_samp>
  4. #pragma tabsize 0
  5.  
  6. #define orange 0xFF9900AA
  7. #define red 0xFF0000AA
  8. #define yellow 0xFFFF00AA
  9.  
  10. new bool:FALSE = false;
  11.  
  12. #define SendClientMessageString(%0,%1,%2,%3) do{new _string[128]; format(_string,sizeof(_string),%2,%3); SendClientMessage(%0,%1,_string);} while(FALSE)
  13.  
  14. new CarFullHealth[MAX_VEHICLES],TimerPlayerInCar[MAX_PLAYERS];
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. print("Survey By tal332255 - Tal Peretz");
  19. SetTimer("SetNumsCars",3000,0);
  20. return 1;
  21. }
  22.  
  23. forward SetNumsCars();
  24. public SetNumsCars()
  25. {
  26. new MAXCAR = CreateVehicle(411,0,0,0,0,0,0,-1);
  27. DestroyVehicle(MAXCAR);
  28.  
  29. for (new car=1; car < MAXCAR; car++)
  30. CarFullHealth[car] = 1;
  31. return 1;
  32. }
  33.  
  34. public OnPlayerStateChange(playerid,newstate,oldstate)
  35. {
  36. if(newstate == PLAYER_STATE_DRIVER) TimerPlayerInCar[playerid] = SetTimerEx("CheckPlayerInCar",1000,1,"%d",playerid);
  37. if(oldstate == PLAYER_STATE_DRIVER) KillTimer(TimerPlayerInCar[playerid]);
  38. return 1;
  39. }
  40.  
  41. public OnVehicleSpawn(vehicleid)
  42. {
  43. CarFullHealth[vehicleid] = 1;
  44. return 1;
  45. }
  46.  
  47. forward CheckPlayerInCar(playerid);
  48. public CheckPlayerInCar(playerid)
  49. {
  50. if(!IsPlayerInAnyVehicle(playerid)) return KillTimer(TimerPlayerInCar[playerid]);
  51.  
  52. new vehicleid = GetPlayerVehicleID(playerid),Float:health;
  53. GetVehicleHealth(vehicleid, health);
  54.  
  55. if(CarFullHealth[vehicleid] == 1 && health < 1000) return CarFullHealth[vehicleid] = 0;
  56.  
  57. if(CarFullHealth[vehicleid] == 0 && health == 1000)
  58. {
  59. for(new i = 0; i <= MAX_PLAYERS; i++)
  60. if(IsPlayerConnected(i) && IsPlayerAdmin(i))
  61. SendClientMessageString(i,yellow, "%s (Id: %d) Is with cheat Fix Vehicle. ",GetName(playerid),playerid);
  62.  
  63. CarFullHealth[vehicleid] = 1;
  64. return 1;
  65. }
  66. return 1;
  67. }
  68.  
  69. forward RepairVehicleEx(vehicleid);
  70. public RepairVehicleEx(vehicleid)
  71. {
  72. CarFullHealth[vehicleid] = 1;
  73. RepairVehicle(vehicleid);
  74. return 1;
  75. }
  76.  
  77. forward SetVehicleHealthEx(vehicleid, Float:health);
  78. public SetVehicleHealthEx(vehicleid, Float:health)
  79. {
  80. if(health == 1000) CarFullHealth[vehicleid] = 1;
  81. SetVehicleHealth(vehicleid, health);
  82. return 1;
  83. }
  84.  
  85. ///////
  86.  
  87.  
  88. stock GetName(playerid){
  89. new Name[MAX_PLAYER_NAME];
  90. GetPlayerName(playerid,Name,sizeof(Name));
  91. return Name;}
Advertisement
Add Comment
Please, Sign In to add comment