Advertisement
Guest User

PDFlashLight by EzeeCube

a guest
Mar 20th, 2014
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. //this filterscript is made by EzeeCube wich tooks light cordinates from redreaper666, I don't care for credits if you need any help add me on skype peroplazar.
  2. //you are free to give me some reputation in samp forum xD
  3.  
  4. #define FILTERSCRIPT
  5.  
  6. #include <a_samp>
  7. #define KEY_AIM (128)
  8.  
  9. new flashlight;
  10.  
  11. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  12. {
  13. if(newkeys & KEY_YES && !IsPlayerInAnyVehicle(playerid))
  14. {
  15. if(flashlight==0)
  16. {
  17. SetPlayerAttachedObject(playerid, 1,18656, 5, 0.1, 0.038, -0.1, -90, 180, 0, 0.03, 0.03, 0.03);
  18. SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
  19. flashlight=1;
  20. return 1;
  21. }
  22. else if(flashlight==1)
  23. {
  24. SetPlayerAttachedObject(playerid, 1,18656, 5, 0.1, 0.038, -0.01, -90, 180, 0, 0.03, 0.1, 0.03);
  25. SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
  26. flashlight=2;
  27. return 1;
  28. }
  29. else if(flashlight==2)
  30. {
  31. RemovePlayerAttachedObject(playerid,1);
  32. RemovePlayerAttachedObject(playerid,2);
  33. flashlight=0;
  34. return 1;
  35. }
  36. }
  37. if(newkeys & KEY_AIM && !IsPlayerInAnyVehicle(playerid))
  38. {
  39. if(flashlight==1)
  40. {
  41. RemovePlayerAttachedObject(playerid,1);
  42. RemovePlayerAttachedObject(playerid,2);
  43. SetPlayerAttachedObject(playerid, 1,18656, 6, 0.25, -0.0155, 0.16, 86.5, -185, 86.5, 0.03, 0.03, 0.03);
  44. SetPlayerAttachedObject(playerid, 2,18641, 6, 0.2, 0.01, 0.16, 90, -95, 90, 1, 1, 1);
  45. flashlight=1;
  46. return 1;
  47. }
  48. else if(flashlight==2)
  49. {
  50. RemovePlayerAttachedObject(playerid,1);
  51. RemovePlayerAttachedObject(playerid,2);
  52. SetPlayerAttachedObject(playerid, 1,18656, 6, 0.16, -0.0155, 0.16, 86.5, -185, 86.5, 0.03, 0.1, 0.03);
  53. SetPlayerAttachedObject(playerid, 2,18641, 6, 0.2, 0.01, 0.16, 90, -95, 90, 1, 1, 1);
  54. flashlight=2;
  55. return 1;
  56. }
  57. }
  58. return 1;
  59. }
  60. public OnPlayerUpdate(playerid)
  61. {
  62. new iCurWeap = GetPlayerWeapon(playerid);
  63. if(iCurWeap != GetPVarInt(playerid, "iCurrentWeapon"))
  64. {
  65. OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap);
  66. SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);
  67. }
  68. return 1;
  69. }
  70.  
  71. stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
  72. {
  73. new oWeapon[24],
  74. nWeapon[24];
  75.  
  76. GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon));
  77. GetWeaponName(newweapon, nWeapon, sizeof(nWeapon));
  78. if(newweapon==WEAPON_DEAGLE || newweapon==WEAPON_M4 || newweapon==WEAPON_SHOTGUN)
  79. {
  80. if(flashlight==1)
  81. {
  82. SetPlayerAttachedObject(playerid, 1,18656, 6, 0.25, -0.0155, 0.16, 86.5, -185, 86.5, 0.03, 0.03, 0.03);
  83. SetPlayerAttachedObject(playerid, 2,18641, 6, 0.2, 0.01, 0.16, 90, -95, 90, 1, 1, 1);
  84. flashlight=1;
  85. return 1;
  86. }
  87. else if(flashlight==2)
  88. {
  89. SetPlayerAttachedObject(playerid, 1,18656, 6, 0.16, -0.0155, 0.16, 86.5, -185, 86.5, 0.03, 0.1, 0.03);
  90. SetPlayerAttachedObject(playerid, 2,18641, 6, 0.2, 0.01, 0.16, 90, -95, 90, 1, 1, 1);
  91. flashlight=2;
  92. return 1;
  93. }
  94. }
  95. else
  96. {
  97. if(flashlight==1)
  98. {
  99. SetPlayerAttachedObject(playerid, 1,18656, 5, 0.1, 0.038, -0.1, -90, 180, 0, 0.03, 0.03, 0.03);
  100. SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
  101. flashlight=1;
  102. return 1;
  103. }
  104. else if(flashlight==2)
  105. {
  106. SetPlayerAttachedObject(playerid, 1,18656, 5, 0.1, 0.038, -0.01, -90, 180, 0, 0.03, 0.1, 0.03);
  107. SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
  108. flashlight=2;
  109. return 1;
  110. }
  111. }
  112. return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement