hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.25. 17:56



Jelenlévő felhasználók

Jelenleg 172 felhasználó van jelen :: 0 regisztrált, 0 rejtett és 172 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Lezárt fórum  A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Plugin hiba
HozzászólásElküldve: 2017.02.12. 15:21 
Offline
Lelkes

Csatlakozott: 2016.12.09. 15:31
Hozzászólások: 25
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 2 alkalommal
Sziasztok valakitudja mi a hiba?
Előre is köszönöm.
  1. public evCTWin( ) { GivePoint( "CT" );
  2. public evTEWin( ) { GivePoint( "TERRORIST" );
  3.  
  4. public GivePoint( const sTeam[ ] )
  5. {
  6.     static iPlayers[ 32 ], iPlrNum, iId;
  7.    
  8.     get_players( iPlayers, iPlrNum, "ech", sTeam );
  9.    
  10.     for ( new i; i < iPlrNum; ++i )
  11.     {
  12.         iId = iPlayers[ i ];
  13.        
  14.         g_iUserData[ iId ][ iPoints ] += g_iRoundKills[ iId ];
  15.         if ( g_iUserData[ iId ][ iPoints ] >= g_iRangs[ g_iRang[ iId ] ][ iRangPoint ] )
  16.         {
  17.             ++g_iRang[ iId ];
  18.             iChatSendCustomData( iId, 0, g_iRangs[ g_iRang[ iId ] - 1 ][ sRangName ] );
  19.         }
  20.        
  21.         SaveDatas( iId, 2 );
  22.     }
  23.     arrayset( g_iRoundKills, 0, sizeof( g_iRoundKills ) );
  24. }
  25.  
  26. public evDeath( )
  27. {
  28.     new iKiller = read_data( 1 );
  29.     new iVictim = read_data( 2 );
  30.     new bool: bTK = get_user_team( iKiller ) == get_user_team( iVictim );
  31.    
  32.     if ( ( iKiller != iVictim ) && !bTK )
  33.     {
  34.         ++g_iUserData[ iKiller ][ iKills ];
  35.         ++g_iUserData[ iVictim ][ iDeaths ];
  36.         ++g_iRoundKills[ iKiller ];
  37.         SaveDatas( iKiller, 2 );
  38.         SaveDatas( iVictim, 2 );
  39.     }  
  40. }
  41.  
  42. public cmdHud( iId ) { ChatColor( iId, "%L", iId, "HUD", iId, ( g_bHud[ iId ] ^= true ) ? "ON" : "OFF" ); }
  43.  
  44. public cmdRang( iId )
  45. {
  46.     static sCurRang[ 32 ], sNextRang[ 32 ], iLen = 0, sMotd[ 2048 ], iMotdLen = charsmax( sMotd );
  47.     copy( sCurRang, charsmax( sCurRang ), g_iRangs[ g_iRang[ iId ] - 1 ][ sRangName ] );
  48.    
  49.     if ( g_iRang[ iId ] < ( MaxRang - 1 ) )
  50.         copy( sNextRang, charsmax( sNextRang ), g_iRangs[ g_iRang[ iId ] ][ sRangName ] );
  51.        
  52.    
  53.     show_motd( iId, sMotd, "Rangrendszer info" );
  54. }
  55.  
  56. public fwClientUserInfoChanged( iId, iBuffer )
  57. {
  58.     if ( !is_user_connected( iId ) ) return FMRES_IGNORED;
  59.    
  60.     static sOldName[ 32 ], sNewName[ 32 ];
  61.     get_user_name( iId, sOldName, charsmax( sOldName ) );
  62.    
  63.     engfunc( EngFunc_InfoKeyValue, iBuffer, "name", sNewName, charsmax( sNewName ) );
  64.    
  65.     if ( equal( sNewName, sOldName ) ) return FMRES_IGNORED;
  66.    
  67.     engfunc( EngFunc_SetClientKeyValue, iId, iBuffer, "name", sOldName );
  68.     client_cmd( iId, "name ^"%s^"; setinfo name ^"%s^"", sOldName, sOldName );
  69.    
  70.     return FMRES_SUPERCEDE;
  71. }
  72.  
  73. public OnlineTimeCounter( iId )
  74. {
  75.     ++g_iUserData[ iId ][ iOnlineTime ];
  76.     ++g_iUserData[ iId ][ iOnlineTimeW ];
  77.    
  78.     if ( g_bHud[ iId ] )
  79.     {
  80.         if ( !is_user_alive( iId ) )
  81.         {
  82.             set_hudmessage( 0, 255, 0, 0.01, 0.20, 0, 6.0, 0.9 );
  83.             new iTarget = entity_get_int( iId, EV_INT_iuser2 );
  84.      
  85.             if ( iTarget != 0 )
  86.             {
  87.                 show_hudmessage( iId, "%L^n%L^n%L^n%L^n%L^n%L^n%L", iId, "HUD1",
  88.                 g_sUsername[ iTarget ], iId, "HUD2",
  89.                 g_iUserData[ iTarget ][ iOnlineTime ] / 3600,( g_iUserData[ iTarget ][ iOnlineTime ] / 60 ) % 60, g_iUserData[ iTarget ][ iOnlineTime ] % 60, iId, "HUD3",
  90.                 g_iUserData[ iTarget ][ iOnlineTimeW ] / 3600, ( g_iUserData[ iTarget ][ iOnlineTimeW ] / 60 ) % 60, g_iUserData[ iTarget ][ iOnlineTimeW ] % 60, iId, "HUD4",
  91.                 g_iUserData[ iTarget ][ iKills ], iId, "HUD5", g_iUserData[ iTarget ][ iDeaths ], iId, "HUD6", g_iRangs[ g_iRang[ iTarget ] - 1 ][ sRangName ], g_iUserData[ iTarget ][ iPoints ], iId, "MOTD10" );
  92.             }
  93.             else
  94.             {
  95.                 show_hudmessage( iId, "%L^n%L^n%L^n%L^n%L^n%L^n%L", iId, "HUD7", iId, "HUD2",
  96.                 g_iUserData[ iId ][ iOnlineTime ] / 3600,(g_iUserData[ iId ][ iOnlineTime ] / 60 ) % 60, g_iUserData[ iId ][ iOnlineTime ] % 60, iId, "HUD3",
  97.                 g_iUserData[ iId ][ iOnlineTimeW ] / 3600, (g_iUserData[ iId ][ iOnlineTimeW ] / 60 ) % 60, g_iUserData[ iId ][ iOnlineTimeW ] % 60, iId, "HUD4",
  98.                 g_iUserData[ iId ][ iKills ], iId, "HUD5", g_iUserData[ iId ][ iDeaths ], iId, "HUD6", g_iRangs[ g_iRang[ iId ] - 1 ][ sRangName ], g_iUserData[ iId ][ iPoints ], iId, "MOTD10" );
  99.             }
  100.         }
  101.     }
  102. }
  103.  
  104. public Save( iNum )
  105. {
  106.     new sNewLine[ 16 ];
  107.    
  108.     formatex( sNewLine, charsmax( sNewLine ), "^"%d^"", iNum );
  109.     write_file( "addons/amxmodx/configs/rangsys.ini", sNewLine, 0 );
  110. }
  111.  
  112. public Load( )
  113. {
  114.     new pFile = fopen( "addons/amxmodx/configs/rangsys.ini", "rt" );
  115.    
  116.     if ( pFile )
  117.     {
  118.         new sLine[ 16 ], sTime[ 64 ], iNum;
  119.         fgets( pFile, sLine, charsmax( sLine ) );
  120.        
  121.         trim( sLine );
  122.         remove_quotes( sLine );
  123.        
  124.         iNum = str_to_num( sLine );
  125.        
  126.         get_time( "%a", sTime, charsmax( sTime ) );
  127.        
  128.         if ( equal( sTime, "Mon" ) )
  129.         {
  130.             if ( iNum == 0 )
  131.             {
  132.                 for ( new i; i < 33; ++i ) g_iUserData[ i ][ iOnlineTimeW ] = 0;
  133.                 Save( 1 );
  134.             }
  135.         }
  136.         else { if ( iNum == 1 ) Save( 0 ); }
  137.        
  138.         fclose(pFile);
  139.     }
  140.     else Save( 0 );
  141. }
  142.  
  143. public client_putinserver( iId )
  144. {
  145.     if ( is_user_bot( iId ) || is_user_hltv( iId ) ) return;
  146.    
  147.     g_iRoundKills[ iId ] = 0;
  148.     g_bHud[ iId ] = true;
  149.     g_iRang[ iId ] = 1;
  150.     arrayset( g_iUserData[ iId ], 0, sizeof( g_iUserData[ ] ) );
  151.    
  152.     get_user_name( iId, g_sUsername[ iId ], charsmax( g_sUsername[ ] ) );
  153.     get_user_authid( iId, g_sAuthID[ iId ], charsmax( g_sAuthID[ ] ) );
  154.     iChatSendCustomData( iId, 0, g_iRangs[ 0 ][ sRangName ] );
  155.    
  156.     LoadDatas( iId );
  157.     set_task( 1.0, "OnlineTimeCounter", iId, _, _, "b" );
  158. }
  159.  
  160. public client_disconnect( iId ) { if ( task_exists( iId ) ) remove_task( iId ); SaveDatas( iId, 2 ); }
  161. public plugin_end( ) { SQL_FreeHandle( g_iSqlTuple ); }
  162.  
  163. stock StrToTime( sTime[ ] )
  164. {
  165.     static sYear[ 7 ], sMonth[ 5 ], sDay[ 5 ], sHour[ 5 ], sMin[ 5 ], iYear, iMonth, iDay, iHour, iMin;
  166.    
  167.     parse( sTime, sYear, charsmax( sYear ), sMonth, charsmax( sMonth ), sDay, charsmax( sDay ), sHour, charsmax( sHour ), sMin, charsmax( sMin ) );
  168.    
  169.     iYear = str_to_num( sYear );
  170.     iMonth = str_to_num( sMonth );
  171.     iDay = str_to_num( sDay );
  172.     iHour = str_to_num( sHour );
  173.     iMin = str_to_num( sMin );
  174.    
  175.     iMonth = GetHoursInMonth( iMonth, iYear ) * 60;
  176.     iYear = ( ( ( iYear % 4 ) == 0 ) ? 366 : 365 ) * 24 * 60;
  177.     iDay *= 1440;
  178.     iHour *= 60;
  179.    
  180.     return iMonth + iYear + iDay + iHour + iMin;
  181. }
  182.  
  183. stock GetHoursInMonth( iMonth, iYear )
  184. {
  185.     static iHour;
  186.     iHour = 0;
  187.     for ( new i = 1; i <= iMonth; ++i )
  188.         iHour += GetDaysInMonth( i, iYear ) * 24;
  189.     return iHour;
  190. }
  191.  
  192. stock GetDaysInMonth( iMonth, iYear )
  193. {
  194.     switch( iMonth )
  195.     {
  196.         case 1, 3, 5, 7, 8, 10, 12: return 31;
  197.         case 2: return ( ( iYear % 4 ) == 0 ) ? 29 : 28;
  198.     }
  199.     return 30;
  200. }
  201.  
  202. stock ChatColor( iId, const sMessage[ ], any:... )
  203. {
  204.     static iPlrNum, iPlayers[ 32 ], sMsg[ 256 ], iIdMsg, iMsgLen = charsmax( sMsg );
  205.    
  206.     vformat( sMsg, iMsgLen, sMessage, 3 );
  207.     format( sMsg, iMsgLen, "!g[%s]!y %s", g_sPrefix, sMsg );
  208.    
  209.     replace_all( sMsg, iMsgLen, "!g", "^4" );
  210.     replace_all( sMsg, iMsgLen, "!y", "^1" );
  211.     replace_all( sMsg, iMsgLen, "!t", "^3" );
  212.  
  213.     if ( !iIdMsg ) iIdMsg = get_user_msgid( "SayText" );
  214.  
  215.     if ( iId )
  216.     {
  217.         iPlayers[ 0 ] = iId;
  218.         iPlrNum = 1;
  219.     }
  220.     else get_players( iPlayers, iPlrNum, "ch" );
  221.  
  222.     for ( new i, iPId; i < iPlrNum; ++i )
  223.     {
  224.         iPId = iPlayers[ i ];
  225.        
  226.         if ( !is_user_connected( iPId ) ) continue;
  227.        
  228.         message_begin( MSG_ONE, iIdMsg, _, iPId );
  229.         write_byte( iPId );
  230.         write_string( sMsg );
  231.         message_end( );
  232.     }
  233. }

Inentől kezdődik a hiba
  1. public evCTWin( ) { GivePoint( "CT" );
  2. public evTEWin( ) { GivePoint( "TERRORIST" );

_________________
Eladó-:
United Warfare Mod
&
The Soul Of Hero Mod


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Plugin hiba
HozzászólásElküldve: 2017.02.12. 16:51 
Offline
Fórum Moderátor
Avatar

Csatlakozott: 2012.07.02. 17:41
Hozzászólások: 1641
Megköszönt másnak: 121 alkalommal
Megköszönték neki: 247 alkalommal
 ! Moderátori megjegyzés (theglorious):
Mivel a téma neve nem utal a téma tartalmára és a hiba sincs leírva ezért dobom kukába.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 
Hozzászólások megjelenítése:  Rendezés  
Lezárt fórum  A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 11 vendég


Nem nyithatsz témákat ebben a fórumban.
Nem válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole