Resolved [ZE] Show Button Pressed BUG

Coding Help/Re-API Supported
Post Reply
Mystic Viper
Senior Member
Senior Member
Romania
Posts: 104
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

[ZE] Show Button Pressed BUG

#1

Post by Mystic Viper » 7 Months Ago

Can someone take an eye on my plugin? Got some errors when try to compile it:

error 035: argument type mismatch (argument 1)
error 035: argument type mismatch (argument 4)
error 035: argument type mismatch (argument 1)

ze_showbuttonpressed.sma
(1.52 KiB) Downloaded 29 times
ze_showbuttonpressed.sma
(1.52 KiB) Downloaded 29 times

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 21
Contact:

#2

Post by Raheem » 7 Months Ago

Not related to our Mod, but here you are:

  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4.  
  5. new const TAG[] = "[ZE]";
  6.  
  7. new g_msgsaytext, bool:g_buttons[1000];
  8.  
  9. new g_butoane;
  10.  
  11. public plugin_init()
  12. {
  13.     RegisterHam(Ham_Use, "func_button", "FwdUseButtonPost", 1);
  14.     register_logevent("endround", 2, "1=Round_End");
  15.    
  16.     take_buttons();
  17.     g_msgsaytext = get_user_msgid("SayText");
  18.     g_butoane = 0;
  19. }
  20.  
  21. public take_buttons()
  22. {
  23.     g_butoane = 0;
  24.     new entid = -1;
  25.     while((entid = engfunc(EngFunc_FindEntityByString, entid, "classname", "func_button")))
  26.     {
  27.         if(!pev_valid(entid))
  28.             continue;
  29.        
  30.         g_buttons[entid] = false;
  31.         g_butoane++;
  32.     }
  33.     server_print("%d butoane ****", g_butoane);
  34. }
  35.  
  36. public endround()
  37.     take_buttons();
  38.  
  39. public FwdUseButtonPost(ent, caller, activator)
  40. {
  41.     if(!g_buttons[ent])
  42.     {
  43.         new name[32];
  44.         get_user_name(activator, name, charsmax(name));
  45.         color(0, ".v%s.g Player.e %s.g press a button!", TAG, name);
  46.         g_buttons[ent] = true;
  47.     }
  48. }
  49.  
  50. stock color( const id, const input[], any: ... )
  51. {
  52.     new count = 1, players[32], i, player;
  53.     static msg[191];
  54.     if ( numargs() == 2 )
  55.         copy( msg, 190, input );
  56.     else
  57.         vformat( msg, 190, input, 3 );
  58.     replace_all( msg, 190, "!g", "^4" );
  59.     replace_all( msg, 190, "!y", "^1" );
  60.     replace_all( msg, 190, "!t", "^3" );
  61.     if ( id )
  62.     {
  63.         if ( !is_user_connected( id ) ) return;
  64.         players[0] = id;
  65.     } else get_players( players, count, "ch" );
  66.     for ( i = 0; i < count; i++ )
  67.     {
  68.         player = players[i];
  69.         message_begin( MSG_ONE_UNRELIABLE, g_msgsaytext, _, player );
  70.         write_byte( player );
  71.         write_string( msg );
  72.         message_end();
  73.     }
  74. }
You don't know? Learn and you will know.

Mystic Viper
Senior Member
Senior Member
Romania
Posts: 104
Joined: 1 Year Ago
Has thanked: 1 time
Been thanked: 3 times
Contact:

#3

Post by Mystic Viper » 7 Months Ago

It's working fine, thank you! :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest