hlmod.hu
https://hlmod.hu/

Reset buttons javítása
https://hlmod.hu/viewtopic.php?f=9&t=11084
Oldal: 1 / 1

Szerző:  norbee.16 [2013.09.26. 21:34 ]
Hozzászólás témája:  Reset buttons javítása

Hali! Valaki javítsa már ki :)

HIBA:
SMA Forráskód: [ Mindet kijelol ]
  1. L 09/26/2013 - 03:03:20: Start of error session.
  2. L 09/26/2013 - 03:03:20: Info (map "deathrun_cxx-inc") (file "addons/amxmodx/logs/error_20130926.log")
  3. L 09/26/2013 - 03:03:20: [AMXX] Displaying debug trace (plugin "resetbuttons.amxx")
  4. L 09/26/2013 - 03:03:20: [AMXX] Run time error 3: stack error
  5. L 09/26/2013 - 10:26:37: Start of error session.
  6. L 09/26/2013 - 10:26:37: Info (map "deathrun_impossible") (file "addons/amxmodx/logs/error_20130926.log")
  7. L 09/26/2013 - 10:26:37: [AMXX] Displaying debug trace (plugin "resetbuttons.amxx")
  8. L 09/26/2013 - 10:26:37: [AMXX] Run time error 3: stack error
  9. L 09/26/2013 - 12:54:25: Start of error session.
  10. L 09/26/2013 - 12:54:25: Info (map "deathrun_cxx-inc") (file "addons/amxmodx/logs/error_20130926.log")
  11. L 09/26/2013 - 12:54:25: [AMXX] Displaying debug trace (plugin "resetbuttons.amxx")
  12. L 09/26/2013 - 12:54:25: [AMXX] Run time error 3: stack error
  13.  


SMA:
SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < engine >
  3.  
  4. public plugin_init( ) {
  5. register_plugin( "Reset Buttons", "1.2", "xPaw" );
  6.  
  7. register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
  8. }
  9.  
  10. public EventNewRound( ) {
  11. new iEntity;
  12.  
  13. while( ( iEntity = find_ent_by_class( iEntity, "func_button" ) ) > 0 )
  14. call_think( iEntity );
  15. }
  16.  

Szerző:  kiki [2013.09.28. 10:02 ]
Hozzászólás témája:  Re: Reset buttons javítása

Try:

SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < engine >
  3. #include < hamsandwich >
  4.  
  5. new Array:g_aButtons;
  6.  
  7. public plugin_init( ) {
  8. register_plugin( "Reset Buttons", "1.3", "xPaw" );
  9.  
  10. if( !find_ent_by_class( -1, "func_button" ) )
  11. pause( "a" );
  12.  
  13. g_aButtons = ArrayCreate( );
  14.  
  15. RegisterHam( Ham_Use, "func_button", "FwdHamButtonUse", 1 );
  16.  
  17. register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
  18. }
  19.  
  20. public plugin_end( )
  21. ArrayDestroy( g_aButtons );
  22.  
  23. public FwdHamButtonUse( const iEntity, const id, const iCaller, const iActivator, const iUseType, const Float:flValue ) {
  24. if( iUseType != 2 || flValue != 1.0 )
  25. return;
  26.  
  27. ArrayPushCell( g_aButtons, iEntity );
  28. }
  29.  
  30. public EventNewRound( ) {
  31. new iSize = ArraySize( g_aButtons );
  32.  
  33. if( !iSize )
  34. return;
  35.  
  36. new iEntity, Trie:tThinked, szDummy[ 2 ];
  37.  
  38. for( new i; i < iSize; i++ ) {
  39. iEntity = ArrayGetCell( g_aButtons, i );
  40.  
  41. szDummy[ 0 ] = iEntity;
  42.  
  43. if( TrieKeyExists( tThinked, szDummy ) )
  44. continue;
  45.  
  46. TrieSetCell( tThinked, szDummy, true );
  47.  
  48. if( is_valid_ent( iEntity ) )
  49. call_think( iEntity );
  50. }
  51.  
  52. TrieDestroy( tThinked );
  53. ArrayClear( g_aButtons );
  54. }
  55.  


Alliedmodson postolta xpaw az eredeti plugin 5. oldalján.

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