Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #if defined Credits
- ________________________________________________________________________________
- * How to use ? :
- Just type in chat /flash and press continuously SPACE.
- ________________________________________________________________________________
- * This filterscript have bugs :
- Currently no.The filterscript was tested and dosen't contain any bug.
- _______________________________________________________________________________
- * You got some errors ? :
- If you got some errors with filterscript , just contact me :
- - Y!M : Darkydarky90@yahoo.com
- - Skype : vLd.ddd
- Or just replay to filterscript post with errors.
- ________________________________________________________________________________
- #endif
- //______________________________________________________________________________
- #define Flash:%0(%1) forward %0(%1); public %0(%1)
- //______________________________________________________________________________
- new
- bool:SpeedEnabled[MAX_PLAYERS],
- PlayerAnimLibrary[MAX_PLAYERS][32],
- PlayerAnimationName[MAX_PLAYERS][32]
- ;
- //______________________________________________________________________________
- Flash:OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (SpeedEnabled[playerid]) Activate(playerid, newkeys);
- return true;
- }
- //______________________________________________________________________________
- Flash:Activate(playerid, player_keys)
- {
- new
- Float:X, Float:Y, Float:Z,
- Float:VX, Float:VY, Float:VZ,
- Float:pAng
- ;
- GetPlayerCameraFrontVector(playerid, VX, VY, VZ);
- GetAnimationName(GetPlayerAnimationIndex(playerid), PlayerAnimLibrary[playerid], 32, PlayerAnimationName[playerid], 32);
- if(strlen(PlayerAnimLibrary[playerid]) && !strcmp(PlayerAnimLibrary[playerid], "ped", true, 3))
- {
- if (player_keys & KEY_SPRINT)
- {
- GetPlayerFacingAngle(playerid, pAng);
- GetPlayerVelocity(playerid, X, Y, Z);
- SetPlayerVelocity(playerid, floatsin(-pAng, degrees) * 1.6, floatcos(pAng, degrees) * 1.6 , (Z*2)+0.03);
- }
- }
- return true;
- }
- //______________________________________________________________________________
- Flash:OnPlayerDisconnect(playerid, reason)
- {
- SpeedEnabled[playerid] = false;
- return true;
- }
- //______________________________________________________________________________
- Flash:OnPlayerSpawn(playerid)
- {
- if (SpeedEnabled[playerid]) SetPlayerHealth(playerid, 0x107FFF);
- return true;
- }
- //______________________________________________________________________________
- Flash:OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/flash", true, 11) && strlen(cmdtext))
- {
- if (SpeedEnabled[playerid])
- {
- SetPlayerHealth(playerid, 100);
- GameTextForPlayer(playerid, "~r~Super-Speed ~w~Disabled !", 1500, 1);
- SpeedEnabled[playerid] = false;
- } else {
- GameTextForPlayer(playerid, "~r~Super-Speed ~w~Activated !", 1200, 1);
- SetPlayerHealth(playerid, 0x107FFF);
- SpeedEnabled[playerid] = true;
- }
- return true;
- }
- return false;
- }
- //______________________________________________________________________________
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement