Hola, alguien le podría hacer la simple modificación de que no haya cvars y directamente se maneje sin ellos?
El hecho de notener mucho conocimiento me dificulto en diferente casos... De paso se quedan con el plugin que lo hizo "hornet" lo encontre en suggestions / requests de AM
Gracias!
El hecho de notener mucho conocimiento me dificulto en diferente casos... De paso se quedan con el plugin que lo hizo "hornet" lo encontre en suggestions / requests de AM
Código PHP:
#include <amxmodx>
#include <cstrike>
#define PLUGIN "Player Prefix"
#define VERSION "0.0.1"
#define AUTHOR "hornet"
new g_pPrefixId, g_pPrefix;
new g_szAuthId[ 32 ][ 33 ];
public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR );
g_pPrefixId = register_cvar( "amx_prefixid", "STEAM_0:0:XXXXXXXXX" );
g_pPrefix = register_cvar( "amx_prefix", "[ Prefix ]" );
register_clcmd( "say", "Cmd_Say" );
register_clcmd( "say_team", "Cmd_SayTeam" );
}
public client_connect( id )
get_user_authid( id, g_szAuthId[ id ], 31 );
public Cmd_Say( id )
{
static szPrefix[ 32 ];
get_pcvar_string( g_pPrefixId, szPrefix, charsmax( szPrefix ) );
if( equal( g_szAuthId[ id ], szPrefix ) )
{
SpecialPrint( id, true );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public Cmd_SayTeam( id )
{
static szPrefix[ 32 ];
get_pcvar_string( g_pPrefixId, szPrefix, charsmax( szPrefix ) );
if( equal( g_szAuthId[ id ], szPrefix ) )
{
SpecialPrint( id, false );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
stock SpecialPrint( const id, bool:bSendAll )
{
static szMsg[ 512 ], szName[ 32 ], szPrefix[ 32 ], szTeam[ 16 ];
read_args( szMsg, charsmax( szMsg ) );
remove_quotes( szMsg );
get_user_name( id, szName, charsmax( szName ) );
get_pcvar_string( g_pPrefix, szPrefix, charsmax( szPrefix ) );
new iNum, iPlayers[ 32 ];
if( !bSendAll )
{
switch( cs_get_user_team( id ) )
{
case CS_TEAM_CT:
{
get_players( iPlayers, iNum, "che", "CT" );
szTeam = "(CT) ";
}
case CS_TEAM_T:
{
get_players( iPlayers, iNum, "che", "TERRORIST" );
szTeam = "(Terrorist) ";
}
case CS_TEAM_SPECTATOR:
{
get_players( iPlayers, iNum, "che", "SPECTATOR" );
szTeam = "(Spectator) ";
}
case CS_TEAM_UNASSIGNED:
{
get_players( iPlayers, iNum, "che", "SPECTATOR" );
szTeam = "(Spectator) ";
}
}
}
else get_players( iPlayers, iNum, "ch" );
format( szMsg, charsmax( szMsg ), "^x01%s%s^x04%s ^x03%s: ^x01%s", is_user_alive( id ) ? "" : "*DEAD* ", bSendAll ? "" : szTeam, szPrefix, szName, szMsg );
for ( new i ; i < iNum ; i++ )
{
if( is_user_connected( iPlayers[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] );
write_byte( iPlayers[ i ] );
write_string( szMsg );
message_end();
}
}
}
Gracias!