HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Reset Control
  2. This plugin allows the admin on the server to control weather or not players should be able to reset there car while driving or not. It can also control how many times
  3. during 1 race a player is allowed reset ( controled by the amx_maxresets cvar )
  4.  
  5. Credits:
  6. OPS in #AMXmod @ Quaknet for alot of help
  7.  
  8. Changelog
  9.  0.9.0
  10. - First release
  11. */
  12.  
  13. #include <amxmodx>
  14. #include <engine>
  15.  
  16. new g_RestCount[33]
  17. new g_MaxResets
  18.  
  19. public plugin_init()
  20. {
  21. register_plugin("Reset control","0.9.0","EKS")
  22. register_cvar("amx_maxresets","2")
  23.  
  24. g_MaxResets = get_cvar_num("amx_maxresets")
  25. register_event("RaceEnd","Echo_ResetResets","a")
  26. }
  27.  
  28. public client_kill(id)
  29. {
  30. if(g_MaxResets == 0)
  31. {
  32. client_print(id,3,"Nem lehet helyre allitani az autodat.")
  33. return PLUGIN_HANDLED
  34. }
  35. if(g_RestCount[id] >= g_MaxResets)
  36. {
  37. client_print(id,3,"Mar nem allithatod helyre az autodat. (%d lehetett csak)",g_MaxResets)
  38. return PLUGIN_HANDLED
  39. }
  40. g_RestCount[id]++
  41. client_print(id,3,"%d/%d helyreallitas.",g_RestCount[id],g_MaxResets)
  42.  
  43. return PLUGIN_CONTINUE
  44. }
  45.  
  46. public Echo_ResetResets()
  47. {
  48. for (new i=1;i<=get_maxplayers();i++)
  49. {
  50. g_RestCount[i]=0
  51. }
  52. }
  53.