Raised This Month: $ Target: $400
 0% 

fix this plugin pls..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-16-2013 , 08:41   Re: fix this plugin pls..
Reply With Quote #1

Remove the semicolon in front of HandleSay(client)
Remove the get_datadir stock
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
nikeboy648
Member
Join Date: Dec 2013
Old 12-16-2013 , 09:30   Re: fix this plugin pls..
Reply With Quote #2

Quote:
Originally Posted by YamiKaitou View Post
Remove the semicolon in front of HandleSay(client)
Remove the get_datadir stock
now I got this errors:

Error: Expected token: ";", but found "public" on line 44
Error: Undefined symbol "ADMIN_ACCESS" on line 53

CODE:

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"
}

public 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;
}

Last edited by nikeboy648; 12-16-2013 at 09:33.
nikeboy648 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode