Advertisement
Guest User

Untitled

a guest
Mar 4th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. // tal332255 - Tal Peretz סקריפט זה הוכן על ידי המתכנת
  2.  
  3. #include <a_samp>
  4. #include <Dini>
  5. #include <dudb>
  6. #pragma tabsize 0
  7.  
  8. #define orange 0xFF9900AA
  9. #define red 0xFF0000AA
  10. #define yellow 0xFFFF00AA
  11.  
  12. new bool:FALSE = false;
  13.  
  14. #define SendClientMessageString(%0,%1,%2,%3) do{new _string[128]; format(_string,sizeof(_string),%2,%3); SendClientMessage(%0,%1,_string);} while(FALSE)
  15.  
  16. new CarFullHealth[MAX_VEHICLES],TimerPlayerInCar[MAX_PLAYERS];
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. print("Survey By tal332255 - Tal Peretz");
  21. SetTimer("SetNumsCars",3000,0);
  22. return 1;
  23. }
  24.  
  25. forward SetNumsCars();
  26. public SetNumsCars()
  27. {
  28. new MAXCAR = CreateVehicle(411,0,0,0,0,0,0,-1);
  29. DestroyVehicle(MAXCAR);
  30.  
  31. for (new car=1; car < MAXCAR; car++)
  32. CarFullHealth[car] = 1;
  33. return 1;
  34. }
  35.  
  36. public OnPlayerStateChange(playerid,newstate,oldstate)
  37. {
  38. if(newstate == PLAYER_STATE_DRIVER) TimerPlayerInCar[playerid] = SetTimerEx("CheckPlayerInCar",1000,1,"%d",playerid);
  39. if(oldstate == PLAYER_STATE_DRIVER) KillTimer(TimerPlayerInCar[playerid]);
  40. return 1;
  41. }
  42.  
  43. public OnVehicleSpawn(vehicleid)
  44. {
  45. CarFullHealth[vehicleid] = 1;
  46. return 1;
  47. }
  48.  
  49. forward CheckPlayerInCar(playerid);
  50. public CheckPlayerInCar(playerid)
  51. {
  52. if(!IsPlayerInAnyVehicle(playerid)) return KillTimer(TimerPlayerInCar[playerid]);
  53.  
  54. new vehicleid = GetPlayerVehicleID(playerid),Float:health;
  55. GetVehicleHealth(vehicleid, health);
  56.  
  57. if(CarFullHealth[vehicleid] == 1 && health < 1000) return CarFullHealth[vehicleid] = 0;
  58.  
  59. if(CarFullHealth[vehicleid] == 0 && health == 1000)
  60. {
  61. for(new i = 0; i <= MAX_PLAYERS; i++)
  62. if(IsPlayerConnected(i) && IsPlayerXAdmin(i))
  63. SendClientMessageString(i,yellow, ".עם חשש לצ'יט תיקון רכב %s (Id: %d)",GetName(playerid),playerid);
  64.  
  65. CarFullHealth[vehicleid] = 1;
  66. return 1;
  67. }
  68. return 1;
  69. }
  70.  
  71. forward RepairVehicleEx(vehicleid);
  72. public RepairVehicleEx(vehicleid)
  73. {
  74. CarFullHealth[vehicleid] = 1;
  75. RepairVehicle(vehicleid);
  76. return 1;
  77. }
  78.  
  79. forward SetVehicleHealthEx(vehicleid, Float:health);
  80. public SetVehicleHealthEx(vehicleid, Float:health)
  81. {
  82. if(health == 1000) CarFullHealth[vehicleid] = 1;
  83. SetVehicleHealth(vehicleid, health);
  84. return 1;
  85. }
  86.  
  87. ///////
  88.  
  89. stock IsPlayerXAdmin(playerid){
  90. new playername[24],file[64];
  91. GetPlayerName(playerid, playername, 24);
  92. format(file,64,"xap/Users/%s.ini",udb_encode(playername));
  93. if(dini_Int(file,"Level") >= 1 && dini_Int(file,"LoggedIn") == 1) return true;
  94. else return false;}
  95.  
  96. stock GetName(playerid){
  97. new Name[MAX_PLAYER_NAME];
  98. GetPlayerName(playerid,Name,sizeof(Name));
  99. return Name;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement