Advertisement
Guest User

Untitled

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