Advertisement
Darky

The Flash

Feb 21st, 2012
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.24 KB | None | 0 0
  1. #include <a_samp>
  2. #define FILTERSCRIPT
  3. #if defined Credits
  4. ________________________________________________________________________________
  5.  * How to use ? :
  6.    Just type in chat /flash and press continuously SPACE.
  7. ________________________________________________________________________________
  8.  * This filterscript have bugs :
  9.    Currently no.The filterscript was tested and dosen't contain any bug.
  10. _______________________________________________________________________________
  11. * You got some errors ? :
  12.   If you got some errors with filterscript , just contact me :
  13.   - Y!M : Darkydarky90@yahoo.com
  14.   - Skype : vLd.ddd
  15.   Or just replay to filterscript post with errors.
  16. ________________________________________________________________________________
  17. #endif
  18. //______________________________________________________________________________
  19. #define Flash:%0(%1) forward %0(%1); public %0(%1)
  20. //______________________________________________________________________________
  21. new
  22.     bool:SpeedEnabled[MAX_PLAYERS],
  23.     PlayerAnimLibrary[MAX_PLAYERS][32],
  24.     PlayerAnimationName[MAX_PLAYERS][32]
  25. ;
  26. //______________________________________________________________________________
  27. Flash:OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  28. {
  29.     if (SpeedEnabled[playerid]) Activate(playerid, newkeys);
  30.     return true;
  31. }
  32. //______________________________________________________________________________
  33. Flash:Activate(playerid, player_keys)
  34. {
  35.        new
  36.        Float:X, Float:Y, Float:Z,
  37.        Float:VX, Float:VY, Float:VZ,
  38.        Float:pAng
  39.        ;
  40.        GetPlayerCameraFrontVector(playerid, VX, VY, VZ);
  41.        GetAnimationName(GetPlayerAnimationIndex(playerid), PlayerAnimLibrary[playerid], 32, PlayerAnimationName[playerid], 32);
  42.        if(strlen(PlayerAnimLibrary[playerid]) && !strcmp(PlayerAnimLibrary[playerid], "ped", true, 3))
  43.        {
  44.            if (player_keys & KEY_SPRINT)
  45.                {
  46.                    GetPlayerFacingAngle(playerid, pAng);
  47.                    GetPlayerVelocity(playerid, X, Y, Z);
  48.                    SetPlayerVelocity(playerid, floatsin(-pAng, degrees) * 1.6, floatcos(pAng, degrees) * 1.6 , (Z*2)+0.03);
  49.                }
  50.         }
  51.        return true;
  52. }
  53. //______________________________________________________________________________
  54. Flash:OnPlayerDisconnect(playerid, reason)
  55. {
  56.    SpeedEnabled[playerid] = false;
  57.     return true;
  58. }
  59. //______________________________________________________________________________
  60. Flash:OnPlayerSpawn(playerid)
  61. {
  62.     if (SpeedEnabled[playerid]) SetPlayerHealth(playerid, 0x107FFF);
  63.     return true;
  64. }
  65. //______________________________________________________________________________
  66. Flash:OnPlayerCommandText(playerid, cmdtext[])
  67. {
  68.     if(!strcmp(cmdtext, "/flash", true, 11) && strlen(cmdtext))
  69.     {
  70.         if (SpeedEnabled[playerid])
  71.          {
  72.             SetPlayerHealth(playerid, 100);
  73.             GameTextForPlayer(playerid, "~r~Super-Speed ~w~Disabled !", 1500, 1);
  74.             SpeedEnabled[playerid] = false;
  75.         } else {
  76.             GameTextForPlayer(playerid, "~r~Super-Speed ~w~Activated !", 1200, 1);
  77.             SetPlayerHealth(playerid, 0x107FFF);
  78.             SpeedEnabled[playerid] = true;
  79.         }
  80.         return true;
  81.     }
  82.     return false;
  83. }
  84. //______________________________________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement