Advertisement
Guest User

Untitled

a guest
Dec 12th, 2011
811
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #define COLOR_LIGHTBLUE 0x0080FFFF
  3. #define PRESSED(%0) \
  4. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  5. #define IsPlayerNotInVehicle(%0) (!IsPlayerInAnyVehicle(%0))
  6. #include <a_samp>
  7. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print(" Car Fix by pressing 2 to fix your car.");
  13. print("--------------------------------------\n");
  14.  
  15. return 1;
  16.  
  17. }
  18. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  19. {
  20. if(PRESSED(KEY_SUBMISSION))
  21. {
  22. new vehicleid = GetPlayerVehicleID(playerid);
  23. if(IsPlayerInVehicle(playerid, vehicleid))
  24. {
  25. SetVehicleHealth(vehicleid,1000.0);
  26. RepairVehicle(GetPlayerVehicleID(playerid));
  27. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  28. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have successfully repaired your car!");
  29. }
  30. }
  31. if(PRESSED(KEY_ACTION))
  32. {
  33. if(IsPlayerNotInVehicle(playerid))
  34. {
  35. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have to be in a car to be able to repair your car!");
  36. }
  37. }
  38. }
  39. #endif
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement