Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <fakemeta>
  5.  
  6. #define PLUGIN "Semiclip"
  7. #define VERSION "1.0"
  8. #define AUTHOR "AJW1337//"
  9.  
  10. new g_iMaxPlayers, g_iPlayerSolid[33], g_iPlayerRestore[33]
  11.  
  12. public plugin_init() {
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14.  
  15. register_forward(FM_PlayerPreThink, "fwd_FM_PlayerPreThink")
  16. register_forward(FM_PlayerPostThink, "fwd_FM_PlayerPostThink")
  17. register_forward(FM_AddToFullPack, "fwd_FM_AddToFullPack", 1)
  18.  
  19. g_iMaxPlayers = get_maxplayers()
  20. }
  21.  
  22. FirstThink()
  23. {
  24. for (new iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++)
  25. {
  26. if (!is_user_alive(iIndex))
  27. {
  28. g_iPlayerSolid[iIndex] = false
  29. continue
  30. }
  31. g_iPlayerRestore[iIndex] = pev(iIndex, pev_solid) == SOLID_SLIDEBOX ? true : false
  32. }
  33. }
  34.  
  35. public fwd_FM_PlayerPreThink(id)
  36. {
  37. static iIndex, iLastThink
  38.  
  39. if(iLastThink > id)
  40. FirstThink()
  41.  
  42. iLastThink = id
  43.  
  44. if (g_iPlayerSolid[id])
  45. return
  46.  
  47. for (iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++)
  48. {
  49. if (!g_iPlayerSolid[iIndex] || id == iIndex)
  50. continue
  51.  
  52. set_pev(iIndex, pev_solid, SOLID_NOT)
  53. g_iPlayerRestore[iIndex] = true
  54. }
  55. }
  56.  
  57. public fwd_FM_PlayerPostThink(id)
  58. {
  59. static iIndex
  60.  
  61. for (iIndex = 1; iIndex <= g_iMaxPlayers; iIndex++)
  62. {
  63. if (g_iPlayerRestore[iIndex])
  64. {
  65. set_pev(iIndex, pev_solid, SOLID_SLIDEBOX)
  66. g_iPlayerRestore[iIndex] = false
  67. }
  68. }
  69. }
  70.  
  71. public fwd_FM_AddToFullPack(es_handle, e, iEnt, iIndex, hostflags, pPlayer, pSet)
  72. {
  73. if (get_user_team(iIndex) != get_user_team(iEnt))
  74. return FMRES_IGNORED
  75.  
  76. if (pPlayer && g_iPlayerSolid[iIndex] && g_iPlayerSolid[iEnt])
  77. {
  78. set_es(es_handle, ES_Solid, SOLID_NOT)
  79. }
  80.  
  81. if (pPlayer && iIndex != iEnt && get_orig_retval() && is_user_alive(iIndex))
  82. {
  83. set_es(es_handle, ES_Solid, SOLID_NOT)
  84. }
  85.  
  86. return FMRES_IGNORED
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement