Advertisement
LeonardoBradoks

Sistema de Bullet Drop SA-MP

Mar 29th, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.94 KB | None | 0 0
  1. /****************************************************************
  2.     [_¯B_¯u_¯l_¯l_¯e_¯t_¯ _¯D_¯r_¯o_¯p_¯ _¯S_¯y_¯s_¯t_¯e_¯m_¯]
  3.     Powered by: Leonardo Bradoks
  4.     Thanks for help: FerrariL & ForT & Carlos001 & RogerCosta
  5.     Forum Thread: http://forum.sa-mp.com/showthread.php?p=4007719
  6. ****************************************************************/
  7.  
  8. #include <a_samp>
  9.  
  10. #define Municao_Amarela     19574
  11. #define Municao_Marrom      19575
  12. #define Municao_Verde       19576
  13. #define Municao_Vermelha    19577
  14.  
  15. new Bala[MAX_PLAYERS];
  16.  
  17. public OnFilterScriptInit()
  18. {
  19.     print("\n-------------------------------------------------------------");
  20.     print("-              INITIALIZED BULLET DROP SYSTEM!              -");
  21.     print("- Thanks for help: FerrariL & ForT & Carlos001 & RogerCosta -");
  22.     print("-------------------------------------------------------------\n");
  23.     return 1;
  24. }
  25.  
  26. public OnObjectMoved(objectid)
  27. {
  28.     if(Municao_Amarela <= GetObjectModel(objectid) <= Municao_Vermelha) {
  29.         new Float:X, Float:Y, Float:Z;
  30.         GetObjectPos(objectid, X, Y, Z);
  31.         CreateExplosion(X, Y, Z, 12, 10.0);
  32.         DestroyObject(objectid);
  33.     }
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  38. {
  39.     if(GetPlayerWeapon(playerid) == 34) {
  40.         new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ, Float:Distancia;
  41.         GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
  42.         Bala[playerid] = CreateObject(Municao_Amarela, fOriginX-0.1, fOriginY, fOriginZ+0.2, 0, 0, 0);
  43.         Distancia = GetPlayerDistanceFromPoint(playerid, fHitPosX, fHitPosY, fHitPosZ);
  44.         MoveObject(Bala[playerid], fHitPosX, fHitPosY, fHitPosZ-(Distancia < 20 ? (Distancia/51) : Distancia > 80 ? (Distancia/25) : (Distancia/50)) , 85.0, 0, 0, 0);
  45.     }
  46.     return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement