HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <zombieplague>
  3. #include <hamsandwich>
  4. #include <fakemeta>
  5.  
  6. #define PLUGIN "[ZP]Extension: Last Human is Survivor"
  7. #define VERSION "1.0"
  8. #define AUTHOR "Bummps"
  9.  
  10. new g_lasthuman[33]
  11. new g_maxplayers
  12. const Float:HUD_EVENT_X = -1.0
  13. const Float:HUD_EVENT_Y = 0.17
  14. new cvar_lasthumansurvivor
  15.  
  16. public plugin_init()
  17. {
  18.  
  19. RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
  20. RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_Post", 1)
  21. register_forward(FM_ClientDisconnect, "fw_ClientDisconnect_Post", 1)
  22. cvar_lasthumansurvivor = register_cvar("zp_lasthuman_survivor", "1")
  23. register_plugin(PLUGIN, VERSION, AUTHOR)
  24. }
  25. public fw_PlayerSpawn_Post()
  26. {
  27. check_last_human()
  28. }
  29. public fw_playerKilled_Post()
  30. {
  31. check_last_human()
  32. }
  33. public fw_ClientDisconnect_post()
  34. {
  35. check_last_human()
  36. }
  37. public check_last_human()
  38. {
  39. static id
  40. for (id = 1; id <= g_maxplayers; id++)
  41. if (get_pcvar_num(cvar_lasthumansurvivor) == 0)
  42. return
  43.  
  44. if (g_lasthuman[id])
  45. {
  46. set_hudmessage(20, 20, 255, HUD_EVENT_X, HUD_EVENT_Y, 1, 0.0, 5.0, 1.0, 1.0, -1)
  47. new name[32]
  48. get_user_name(id, name, 31)
  49. show_hudmessage(0, "%s Utolso ember igy tulelo lett!", name)
  50. zp_make_user_survivor(id)
  51. }
  52. }
  53. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  54. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
  55. */
  56.