PHP Code:
#include <amxmodx>
new iTeamScore[2];
new pCvar_TaskTime;
public plugin_precache()
{
precache_generic( "gfx/career/scoreboard.tga" );
}
public plugin_init()
{
register_plugin( "Team Score", "1.0", "" );
register_event( "TeamScore", "Event_TeamScore", "a" );
pCvar_TaskTime = register_cvar( "amx_task_time", "9999" );
register_clcmd( "/score", "cmdScore" );
}
public cmdScore( id )
{
if( !is_user_connected( id ) )
{
static iMsg[ 128 ];
format( iMsg, charsmax( iMsg ), "^n%d %d", iTeamScore[ 1 ], iTeamScore[ 0 ] );
Create_Show( id, iMsg );
}
}
public Event_TeamScore()
{
new iTeam[ 2 ];
read_data( 1, iTeam, charsmax( iTeam ) );
if( iTeam[ 0 ] == 'C' )
iTeamScore[ 0 ] = read_data( 2 );
else
iTeamScore[ 1 ] = read_data( 2 );
}
stock Create_Show( id, iMsg[] )
{
message_begin( MSG_ONE, get_user_msgid( "TutorText" ), _, id );
write_string( iMsg );
write_byte( 0 );
write_short( 0 ); // is that position y ?
write_short( -1 ); // is that position x ?
message_end();
remove_task( id );
set_task( get_pcvar_float( pCvar_TaskTime ), "Remove_Show", id );
}
Why the GFX doesn't want to show?