hlmod.hu
https://hlmod.hu/

Legjobb fejlövés
https://hlmod.hu/viewtopic.php?f=9&t=9612
Oldal: 1 / 1

Szerző:  pixxa112 [2013.07.20. 06:22 ]
Hozzászólás témája:  Legjobb fejlövés

Hali.

Valaki el tudná mondani, hogy ezt a plugin miért nem működik:
SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < amxmisc >
  3. #include < hamsandwich >
  4. #include < colorchat >
  5.  
  6. #define TAG "^x04[AMXX]^x01"
  7. #define FCVARS (FCVAR_SERVER | FCVAR_PROTECTED)
  8.  
  9. static const dates[ ][ ] =
  10. {
  11. "Headshot Verseny...",
  12. "1.8",
  13. "Keszitette: Luggas | Forditotta: Chris"
  14. }
  15.  
  16. new const name_cvar[ ][ ] = {
  17. "amx_headshots_logs",
  18. "amx_headshots_saymode"
  19. }
  20.  
  21. new const value_cvar[ ][ ] = {
  22. "1",
  23. "0"
  24. }
  25.  
  26. /* Enums */
  27. enum
  28. {
  29. CVAR_LOGS = 0,
  30. CVAR_SAYMODE,
  31. }
  32.  
  33. enum
  34. {
  35. PLUGIN_NAME,
  36. PLUGIN_VERSION,
  37. PLUGIN_AUTHOR
  38. }
  39. /* Enums End*/
  40.  
  41. new cvars[2]
  42.  
  43. new g_mostheadshots[33]
  44.  
  45. public plugin_init() {
  46. register_plugin( dates[PLUGIN_NAME], dates[PLUGIN_VERSION], dates[PLUGIN_AUTHOR])
  47.  
  48. register_event( "DeathMsg" , "Event_DeathMsg" , "a" , "3=1" );
  49.  
  50. register_event( "30" , "event_intermission" , "a" );
  51.  
  52. register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
  53.  
  54. cvars[0] = register_cvar( name_cvar[CVAR_LOGS] , value_cvar[CVAR_LOGS] );
  55. cvars[1] = register_cvar( name_cvar[CVAR_SAYMODE], value_cvar[CVAR_SAYMODE]);
  56.  
  57.  
  58. register_cvar( "Best Player Headshot | SQL" , dates[PLUGIN_AUTHOR] , FCVARS );
  59.  
  60. register_event( "TextMsg", "Event_GameRestart", "a", "2=#Game_will_restart_in");
  61.  
  62. register_event( "TextMsg", "Event_GameRestart", "a", "2=#Game_Commencing" );
  63.  
  64. }
  65.  
  66. public Event_GameRestart( ) arrayset( g_mostheadshots, 0, 33 )
  67. public client_disconnect( id ) g_mostheadshots[ id ] = 0
  68. public event_intermission( ) set_task( 0.1, "BestHeadPlayer")
  69.  
  70. public event_round_start( )
  71. {
  72. if( get_pcvar_num( cvars[1] ) )
  73. set_task(0.1, "BestHeadPlayer");
  74. }
  75. public BestHeadPlayer( )
  76. {
  77. new iPlayers[ 32 ], iNum
  78. get_players( iPlayers, iNum )
  79.  
  80. if( !iNum )
  81. {
  82. return;
  83. }
  84.  
  85. new iBestPlayerHeadshot = iPlayers[ 0 ]
  86.  
  87. for(new i = 1, id; i < iNum; i++)
  88. {
  89. id = iPlayers[ i ]
  90.  
  91. if(g_mostheadshots[ id ] > g_mostheadshots[ iBestPlayerHeadshot ])
  92. {
  93. iBestPlayerHeadshot = id
  94. }
  95. }
  96.  
  97. new szName[ 32 ]
  98. get_user_name( iBestPlayerHeadshot , szName , charsmax(szName) )
  99. if(g_mostheadshots[ iBestPlayerHeadshot ] > 0)
  100. ColorChat(0, GREEN, "[Just]^1 A nyertes pedig nem mas mint:^4 %s^1 osszesen^4 %d^1 fejessel!" , TAG , szName , g_mostheadshots[ iBestPlayerHeadshot ] , g_mostheadshots[ iBestPlayerHeadshot ] > 1 ? "s." : "." )
  101. else
  102. ColorChat(0, GREEN, "[Just]^1 Senki nem nyert ebben a korben!", TAG )
  103.  
  104. if( !cvars[1] && cvars[0] && g_mostheadshots[ iBestPlayerHeadshot ] > 0) {
  105. static mapname[ 32 ]
  106. get_mapname(mapname, sizeof mapname - 1)
  107.  
  108. static Steam[ 32 ]
  109. get_user_authid( iBestPlayerHeadshot, Steam, charsmax(Steam))
  110.  
  111. log_to_file( "best_headshot.log" , "Palya %s | Legjobb jatekos: %s | Fejesek: %d | STEAM ID: %s" , mapname , szName , g_mostheadshots[ iBestPlayerHeadshot ], Steam)
  112. }
  113. return
  114. }
  115.  
  116. public Event_DeathMsg( )
  117. {
  118. new iAttack = read_data( 1 )
  119.  
  120. if ( read_data( 2 ) != iAttack )
  121. g_mostheadshots[ iAttack ]++
  122.  
  123. return PLUGIN_HANDLED
  124. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/