Solved [ZE] Show Button Pressed BUG

Coding Help/Re-API Supported
Post Reply
Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

[ZE] Show Button Pressed BUG

#1

Post by Templaso » 5 years 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 354 times
ze_showbuttonpressed.sma
(1.52 KiB) Downloaded 354 times

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 5 years 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. }
He who fails to plan is planning to fail

Templaso
Senior Member
Senior Member
Romania
Posts: 119
Joined: 5 years ago
Location: Bucharest
Contact:

#3

Post by Templaso » 5 years ago

It's working fine, thank you! :)

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 2 guests