Advertisement
lsreskjn

NumPad Commands

Jul 29th, 2013
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. // kjn's NumPad Commands for StuntServer FilterScript
  2. // NumPad 8 - Will repair the vehicle.
  3. // NumPad 6 - Will install Nitro component to vehicle.
  4. // NumPad 4 - Will flip the vehicle.
  5.  
  6.  
  7. #define FILTERSCRIPT
  8.  
  9. #include <a_samp>
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print("kjn's NumPad Commands FilterScript");
  17. print("--------------------------------------\n");
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. #else
  27.  
  28. main()
  29. {
  30. print("\n----------------------------------");
  31. print("kjn's NumPad Commands FilterScript");
  32. print("----------------------------------\n");
  33. }
  34.  
  35. #endif
  36.  
  37.  
  38.  
  39.  
  40. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  41. {
  42. if(IsPlayerInAnyVehicle(playerid))
  43. {
  44. if(newkeys & KEY_ANALOG_UP) // NumPad 8
  45. {
  46. new vehicleid = GetPlayerVehicleID(playerid);
  47. SetVehicleHealth(vehicleid, 1000.0);
  48. RepairVehicle(GetPlayerVehicleID(playerid));
  49. SendClientMessage(playerid, 0x800080FF, "[ Server ] Vehicle repaired.");
  50. return 1;
  51. }
  52. if(newkeys & KEY_ANALOG_RIGHT) //NumPad 6
  53. {
  54. AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
  55. SendClientMessage(playerid,0x800080FF,"[ Server ] Nitro added.");
  56. return 1;
  57. }
  58. if(newkeys & KEY_ANALOG_LEFT) //NumPad 4
  59. {
  60. new currentveh;
  61. new Float:angle;
  62. currentveh = GetPlayerVehicleID(playerid);
  63. GetVehicleZAngle(currentveh, angle);
  64. SetVehicleZAngle(currentveh, angle);
  65. SendClientMessage(playerid, 0x800080FF, "[ Server ] Vehicle fliped.");
  66. return 1;
  67. }
  68. }
  69. return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement