Guest User

Car System by Phoenix1

a guest
Oct 14th, 2012
1,369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. #if defined PhoenixCarSystem
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print(" Car Sytem Loaded by: Phoenix ");
  13. print("--------------------------------------\n");
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26. print("\n----------------------------------");
  27. print(" Car System Loaded by: Phoenix ");
  28. print("----------------------------------\n");
  29. }
  30.  
  31. #endif
  32.  
  33. public OnGameModeInit()
  34. {
  35. return 1;
  36. }
  37.  
  38. public OnGameModeExit()
  39. {
  40. return 1;
  41. }
  42. // Simple [FS] Car System by: Phoenix :P you can copy and paste it i get all information to Samp Wiki
  43. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  44. {
  45. if (newkeys == KEY_SUBMISSION) // Press 2 and repair you vehicle
  46. {
  47. new vehicleid = GetPlayerVehicleID(playerid);
  48. if(IsPlayerInVehicle(playerid, vehicleid))
  49. {
  50. SetVehicleHealth(vehicleid,1000.0);
  51. RepairVehicle(GetPlayerVehicleID(playerid));
  52. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  53. GameTextForPlayer(playerid,"~b~Car Fixed",3000,3); // Change Here "Lenguage"
  54. }
  55. }
  56. if (newkeys & KEY_CROUCH) // Press h or Block Mayusc and Jump you car
  57. {
  58. if(IsPlayerInAnyVehicle(playerid))
  59. {
  60. new
  61. Float:x,
  62. Float:y,
  63. Float:z;
  64.  
  65. GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
  66. SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z + 0.2);
  67. }
  68. } // Nitro start here
  69. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || !CheckNitro(GetPlayerVehicleID(playerid))) return false; else if ((((newkeys & (4)) == (4)) && ((oldkeys & (4)) != (4)))) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); else if ((((newkeys & (4)) != (4)) && ((oldkeys & (4)) == (4)))) RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  70. return 1;
  71. }
  72. CheckNitro(vid)
  73. {
  74. new NoNitro[] = { 522,481,441,468,448,446,513,521,510,430,520,476,463 };
  75. for(new f = 0; f < sizeof(NoNitro); f++) if(GetVehicleModel(vid) == NoNitro[f]) return false;
  76. return true;
  77. }
Advertisement
Add Comment
Please, Sign In to add comment