| nikeboy648 |
12-16-2013 08:25 |
fix this plugin pls..
this is the errors:
Error: Symbol already defined: "get_datadir" on line 128
Warning: Symbol is never used: "HandleSay" on line 130
this is the plugin:
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define USE_COLORCHAT ""
#define PLUGIN_TAG "Song"
#define MAX_QUESTIONS 64
#if defined USE_COLORCHAT
#include <colorchat>
#endif
#pragma semicolon 1
new g_file[ MAX_QUESTIONS ];
new Questions[ 64 ][ MAX_QUESTIONS ];
new Answers[ 64 ][ MAX_QUESTIONS ];
new RandomAsked;
new bool:QuestionAsked;
public plugin_init( )
{
new dir[ 64 ];
get_datadir( dir, charsmax( dir ) );
formatex( g_file, charsmax( g_file ), "%s/Song.ini", dir );
register_clcmd( "say", "HandleSay" );
register_clcmd( "say_team", "HandleSay" );
QuestionAsked = false;
}
new endsound[ ][ ] =
{
"TxP/SongEvent1.mp3",
}
; HandleSay( client )
{
new arg[ 10 ];
read_argv( client, arg, charsmax( arg ) );
client_cmd( 0, "mp3 play ^"sound/%s^"", endsound[ random( sizeof( endsound ) ) ] );
if ( equali( arg, "/song" ) || equali( arg, "!song" ) )
{
if ( get_user_flags( client ) & ADMIN_ACCESS )
{
if ( !QuestionAsked )
{
Trivia( client );
}
else
{
#if defined USE_COLORCHAT
ColorChat( client, TEAM_COLOR, "^4[ %s ] The^4 Event^1 is already^4 Enabled.", PLUGIN_TAG );
#else
client_print( client, print_chat, "The Event is already Enabled." );
#endif
}
}
else
{
#if defined USE_COLORCHAT
ColorChat( client, TEAM_COLOR, "^4[ %s ] You dont have access to this^4 Command.", PLUGIN_TAG );
#else
client_print( client, print_chat, "You dont have access to this Command." );
#endif
}
}
else if ( QuestionAsked )
{
if ( equali( arg, Answers[ RandomAsked ] ) )
{
new NameSz[ 32 ];
get_user_name( client, NameSz, charsmax( NameSz ) );
#if defined USE_COLORCHAT
ColorChat( client, TEAM_COLOR, "^4[ %s ]^3 %s^1 Answered Correct:^4 ''%s''", PLUGIN_TAG, NameSz, arg );
#else
client_print( client, print_chat, "^4%s Answered Correct: ''%s''^3", NameSz, arg );
#endif
QuestionAsked = false;
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public Trivia( client )
{
new file = fopen( g_file, "rt" );
new data[ 128 ];
new question[ MAX_QUESTIONS ];
new answer[ MAX_QUESTIONS ];
new i = 0;
while ( !feof( file ) )
{
i++;
fgets( file, data, charsmax( data ) );
parse( data, question, 31, answer, 31 );
formatex( Questions[ i ], charsmax( Questions ), question );
formatex( Answers[ i ], charsmax( Answers ), answer );
replace_all( Questions[ i ], charsmax( Questions ), "_", " " );
}
RandomAsked = random_num( 1, i );
QuestionAsked = true;
}
stock get_datadir( name[ ],len )
{
return get_localinfo( "amxx_datadir", name, len );
}
Fix it please!
|