Guest User

Dah Sys (FS)

a guest
Nov 8th, 2018
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. //FS
  2. /* DAH SYSTEM */
  3. #include <a_samp>
  4.  
  5. #if defined FILTERSCRIPT
  6. public OnFilterScriptInit()
  7. {
  8. print("\n--------------------------------------");
  9. print(" Dah System - Winter Edition -");
  10. print("--------------------------------------\n");
  11. return 1;
  12. }
  13.  
  14. public OnFilterScriptExit()
  15. {
  16. return 1;
  17. }
  18.  
  19. #else
  20.  
  21. main()
  22. {
  23. print("\n----------------------------------");
  24. print(" Dah System - Winter Edition -");
  25. print("----------------------------------\n");
  26. }
  27.  
  28. #endif
  29. //stock za GetSpeed
  30. stock GetSpeed(playerid) {
  31. new Float:ST[4];
  32. if(IsPlayerInAnyVehicle(playerid))
  33. GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
  34. else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
  35. ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 178.8617875;
  36. return floatround(ST[3]); }
  37. //------------------------------------------------------------------------------ Dah system by Deksa
  38. //new
  39. new PlayerEffect[ MAX_PLAYERS ], PlayerRun[ MAX_PLAYERS ], EffectTimer[ MAX_PLAYERS ];
  40. #define OBJECT_SLOT_FREE 3
  41. forward ActionEffect();
  42. public ActionEffect() {
  43. for(new i; i < GetMaxPlayers(); i++) {
  44. if( GetPlayerInterior( i ) == 0 && GetPlayerVirtualWorld( i ) == 0 ) {
  45. RemovePlayerAttachedObject( i, OBJECT_SLOT_FREE );
  46. PlayerEffect[ i ] = SetPlayerAttachedObject( i, OBJECT_SLOT_FREE, 18696, 2,0.0,0.1,-0.2,-25.5000,0.0,0.0,0.10,0.3,0.15);
  47. if( GetSpeed( i ) > 10 && PlayerRun[ i ] == 0 ) {
  48. KillTimer( EffectTimer[ i ] );
  49. EffectTimer[ i ] = SetTimerEx("ActionEffect", 890, true, "d", i );
  50. PlayerRun[ i ] = 1; }
  51. else if( GetSpeed( i ) < 10 && PlayerRun[ i ] == 1 ) {
  52. KillTimer( EffectTimer[ i ] );
  53. EffectTimer[ i ] = SetTimerEx( "ActionEffect", 1900, true, "d", i );
  54. PlayerRun[ i ] = 0; } } } }
  55. //------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment