Page 1 of 1
[ZE] Show Button Pressed BUG
Posted: 25 Mar 2019, 18:25
by Templaso
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)
Re: [ZE] Show Button Pressed BUG
Posted: 26 Mar 2019, 19:00
by Raheem
Not related to our Mod, but here you are:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new const TAG[] = "[ZE]";
new g_msgsaytext, bool:g_buttons[1000];
new g_butoane;
public plugin_init()
{
RegisterHam(Ham_Use, "func_button", "FwdUseButtonPost", 1);
register_logevent("endround", 2, "1=Round_End");
take_buttons();
g_msgsaytext = get_user_msgid("SayText");
g_butoane = 0;
}
public take_buttons()
{
g_butoane = 0;
new entid = -1;
while((entid = engfunc(EngFunc_FindEntityByString, entid, "classname", "func_button")))
{
if(!pev_valid(entid))
continue;
g_buttons[entid] = false;
g_butoane++;
}
server_print("%d butoane ****", g_butoane);
}
public endround()
take_buttons();
public FwdUseButtonPost(ent, caller, activator)
{
if(!g_buttons[ent])
{
new name[32];
get_user_name(activator, name, charsmax(name));
color(0, ".v%s.g Player.e %s.g press a button!", TAG, name);
g_buttons[ent] = true;
}
}
stock color( const id, const input[], any: ... )
{
new count = 1, players[32], i, player;
static msg[191];
if ( numargs() == 2 )
copy( msg, 190, input );
else
vformat( msg, 190, input, 3 );
replace_all( msg, 190, "!g", "^4" );
replace_all( msg, 190, "!y", "^1" );
replace_all( msg, 190, "!t", "^3" );
if ( id )
{
if ( !is_user_connected( id ) ) return;
players[0] = id;
} else get_players( players, count, "ch" );
for ( i = 0; i < count; i++ )
{
player = players[i];
message_begin( MSG_ONE_UNRELIABLE, g_msgsaytext, _, player );
write_byte( player );
write_string( msg );
message_end();
}
}
Re: [ZE] Show Button Pressed BUG
Posted: 27 Mar 2019, 06:51
by Templaso
It's working fine, thank you!