Raised This Month: $ Target: $400
 0% 

fix this plugin pls..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-16-2013 , 18:44   Re: fix this plugin pls..
Reply With Quote #1

PHP 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_fileMAX_QUESTIONS ];

new 
Questions64 ][ MAX_QUESTIONS ];
new 
Answers64 ][ MAX_QUESTIONS ];

new 
RandomAsked;

new 
bool:QuestionAsked;

public 
plugin_init( )
{
    new 
dir64 ];
    
get_datadirdircharsmaxdir ) );
    
    
formatexg_filecharsmaxg_file ), "%s/Song.ini"dir );
    
    
register_clcmd"say""HandleSay" );
    
register_clcmd"say_team""HandleSay" );
    
    
QuestionAsked false;
}

new 
endsound[ ][ ] =
{
    
"TxP/SongEvent1.mp3"
};

public 
HandleSayclient )
{
    new 
arg10 ];
    
    
read_argvclientargcharsmaxarg ) );
    
client_cmd0"mp3 play ^"sound/%s^""endsoundrandomsizeofendsound ) ) ] );
    
    if ( 
equaliarg"/song" ) || equaliarg"!song" ) )
    {
        if ( 
get_user_flagsclient ) & ADMIN_KICK )
        {
            if ( !
QuestionAsked )
            {
                
Triviaclient );
            }
            else
            {
                
#if defined USE_COLORCHAT
                    
ColorChatclientTEAM_COLOR"^4[ %s ] The^4 Event^1 is already^4 Enabled."PLUGIN_TAG );
                
#else
                    
client_printclientprint_chat"The Event is already Enabled." );
                
#endif
            
}
        }
        else
        {
            
#if defined USE_COLORCHAT
                
ColorChatclientTEAM_COLOR"^4[ %s ] You dont have access to this^4 Command."PLUGIN_TAG );
            
#else
                
client_printclientprint_chat"You dont have access to this Command." );
            
#endif
        
}
    }
    else if ( 
QuestionAsked )
    {
        if ( 
equaliargAnswersRandomAsked ] ) )
        {
            new 
NameSz32 ];
            
            
get_user_nameclientNameSzcharsmaxNameSz ) );
            
            
#if defined USE_COLORCHAT
                
ColorChatclientTEAM_COLOR"^4[ %s ]^3 %s^1 Answered Correct:^4 ''%s''"PLUGIN_TAGNameSzarg );
            
#else
                
client_printclientprint_chat"^4%s Answered Correct: ''%s''^3"NameSzarg );
            
#endif
            
            
QuestionAsked false;
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}
        
public 
Triviaclient )
{    
    new 
file fopeng_file"rt" );
    new 
data128 ];
    new 
questionMAX_QUESTIONS ];
    new 
answerMAX_QUESTIONS ];
    
    new 
0;
    
    while ( !
feoffile ) )
    {
        
i++;
        
        
fgetsfiledatacharsmaxdata ) );
        
parsedataquestion31answer31 );
        
        
formatexQuestions], charsmaxQuestions ), question );
        
formatexAnswers], charsmaxAnswers ), answer );
        
        
replace_allQuestions], charsmaxQuestions ), "_"" " );
    }
    
    
RandomAsked random_num1);
    
QuestionAsked true;

If you want to change the admin access, so that here
PHP Code:
if ( get_user_flagsclient ) & ADMIN_KICK 

Last edited by Fuck For Fun; 12-16-2013 at 18:46.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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