Advertisement
System32

S32_Vehicle+

Sep 3rd, 2011
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.96 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnFilterScriptInit()
  4. {
  5.     print("\n");
  6.     print("  \4\4\4\4\4\4\4\4\4\4\4\4\4\4\4");
  7.     print("  \4 S32Vehicle+ \4");
  8.     print("  \4 by          \4");
  9.     print("  \4 System32    \4");
  10.     print("  \4\4\4\4\4\4\4\4\4\4\4\4\4\4\4\n");
  11.     return 1;
  12. }
  13.  
  14. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  15. {
  16.     if(newkeys == KEY_SUBMISSION)
  17.     {
  18.         if(IsPlayerInAnyVehicle(playerid))
  19.         {
  20.             if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  21.             {
  22.                     RepairVehicle(GetPlayerVehicleID(playerid));
  23.             }
  24.         }
  25.     }
  26.     if (newkeys & KEY_ACTION)
  27.     {
  28.         if(IsPlayerInAnyVehicle(playerid))
  29.         {
  30.             new Float: Pos[3];
  31.             GetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  32.             SetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2] + 0.3);
  33.         }
  34.     }
  35.     if(newkeys & KEY_CROUCH)
  36.     {
  37.         new Float: Pos[4];
  38.         GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  39.         GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);  SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]); SetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  40.     }
  41.     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);
  42.     return 1;
  43. }
  44.  
  45. stock CheckNitro(vid)
  46. {
  47.     new NoNitro[] = { 522,481,441,468,448,446,513,521,510,430,520,476,463 };
  48.     for(new e = 0; e < sizeof(NoNitro); e++) if(GetVehicleModel(vid) == NoNitro[e]) return false;
  49.     return true;
  50. }
  51. /*=======================================================S32Vehicle+=======================================================
  52. Credits to System32*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement