Advertisement
LVPYassine

Untitled

Jan 15th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. /**
  2. * Copyright (c) 2015-2016 Fighting & Interior Manager
  3. *
  4. * This program is free software: you can Ristribute it and/or modify it under the terms of the
  5. * GNU General Public License as published by the Free Software Foundation, either version 3 of the
  6. * License, or (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  9. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. * General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License along with this program.
  13. * If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. /*AUTHOR ***********************
  17. @Yaa - SA-MP Scripter
  18. ********************************/
  19.  
  20. #if defined _FIMANAGER_
  21. #endinput
  22. #endif
  23. #define _FIMANAGER_
  24.  
  25. new bool:IsFighting[MAX_PLAYERS];
  26. new bool:IsInterior[MAX_PLAYERS];
  27.  
  28. forward onPlayerFinishFight(playerid);
  29. forward OnPlayerStartFighting(playerid);
  30. forward OnPlayerEnterInterior(playerid);
  31. forward IsPlayerFighting(playerid);
  32. forward IsPlayerInInterior(playerid);
  33.  
  34. // Fighting Manager =========================================================================
  35.  
  36. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  37. {
  38. if(IsFighting[playerid] == true) return 1;
  39. IsFighting[playerid] = true;
  40. CallLocalFunction("OnPlayerStartFighting", "i", i);
  41. SetTimerEx("onPlayerFinishFight", 15*1000, false, "i", playerid);
  42. #if defined VFUNC_OnPlayerWeaponShot
  43. return VFUNC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  44. #else
  45. return 1;
  46. #endif
  47. }
  48. #if defined VFUNC_OnPlayerWeaponShot
  49. forward VFUNC_OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, fX, fY, fZ);
  50. #endif
  51. #if defined _ALS_OnPlayerWeaponShot
  52. #undef OnPlayerWeaponShot
  53. #else
  54. #define _ALS_OnPlayerWeaponShot
  55. #endif
  56. #define OnPlayerWeaponShot VFUNC_OnPlayerWeaponShot
  57.  
  58. public IsPlayerFighting(playerid)
  59. if(IsFighting[playerid] == true) return 1;
  60. else return 0;
  61.  
  62. public onPlayerFinishFight(playerid)
  63. {
  64. IsFighting[playerid] = 0;
  65. return 1;
  66. }
  67.  
  68. // Interior Manager =========================================================================
  69.  
  70. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  71. {
  72. if(oldinteriorid == 0 && newinteriorid != 0)
  73. {
  74. IsInterior[playerid] = true;
  75. CallLocalFunction("OnPlayerEnterInterior", "i", i);
  76. return 1;
  77. }
  78. else if(oldinteriorid != 0 && newinteriorid == 0)
  79. {
  80. IsInterior[playerid] = false;
  81. return 1;
  82. }
  83. #if defined VFUNC_OnPlayerInteriorChange
  84. return VFUNC_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  85. #else
  86. return 1;
  87. #endif
  88. }
  89. #if defined VFUNC_OnPlayerInteriorChange
  90. forward VFUNC_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  91. #endif
  92. #if defined _ALS_OnPlayerInteriorChange
  93. #undef OnPlayerInteriorChange
  94. #else
  95. #define _ALS_OnPlayerInteriorChange
  96. #endif
  97. #define OnPlayerInteriorChange VFUNC_OnPlayerInteriorChange
  98.  
  99. public IsPlayerInInterior(playerid)
  100. if(IsInterior[playerid] == true) return 1;
  101. else return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement