Raised This Month: $ Target: $400
 0% 

need help with amxx scripting, would appreciate if you would help me


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-27-2011 , 10:11   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #1

Like this:

PHP Code:
new g_iQuestion33 ];

new const 
g_szQuestions[][] = { "Are you allowed to teamkill?",
                
"Question 2",
                
"Question 3" };
                
new 
g_iAnswers[] = { 21};
//no, yes, yes

public ShowQuestionid )
{
    new 
szMenuStr64 ];
    
g_iQuestionid ] = randomsizeof g_szQuestions);
    
formatszMenuStrcharsmaxszMenuStr ), "\y%s"g_szQuestionsg_iQuestionid ] ] );
    new 
menu menu_createszMenuStr"handleQuestion" );
    
    
menu_additemmenu"Yes""1");
    
menu_additemmenu"No""2");
    
    
menu_setpropmenuMPROP_EXITMEXIT_NEVER );
    
menu_displayidmenu); 
}

public 
handleQuestionidmenuitem )
{
    new 
data], szName32 ];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), szNamecharsmaxszName ), callback );
    
    new 
key str_to_numdata );
    
    if( 
key != g_iAnswersg_iQuestionid ] ] )
    {
        
server_cmd"kick #%d ^"You failed to answer the question correctly^""id );
    }

hornet is offline
ajjt
Junior Member
Join Date: Jul 2011
Old 07-28-2011 , 15:38  
Reply With Quote #2

PHP Code:
new g_iQuestion33 ];

new const 
g_szQuestions[][] = { "Are you allowed to teamkill?",
                
"Question 2",
                
"Question 3" };
                
new 
g_iAnswers[] = { 21};
//no, yes, yes

public ShowQuestionid )
{
    new 
szMenuStr64 ];
    
g_iQuestionid ] = randomsizeof g_szQuestions);
    
formatszMenuStrcharsmaxszMenuStr ), "\y%s"g_szQuestionsg_iQuestionid ] ] );
    new 
menu menu_createszMenuStr"handleQuestion" );
    
    
menu_additemmenu"Yes""1");
    
menu_additemmenu"No""2");
    
    
menu_setpropmenuMPROP_EXITMEXIT_NEVER );
    
menu_displayidmenu); 
}

public 
handleQuestionidmenuitem )
{
    new 
data], szName32 ];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), szNamecharsmaxszName ), callback );
    
    new 
key str_to_numdata );
    
    if( 
key != g_iAnswersg_iQuestionid ] ] )
    {
        
server_cmd"kick #%d ^"You failed to answer the question correctly^""id );
    }

new 
g_iQuestion33 ];

new const 
g_szQuestions[][] = { "Are you allowed to freekill?",
                
"Question 2",
                
"Question 3" };
                
new 
g_iAnswers[] = { 21};
//no, yes, yes

public ShowQuestionid )
{
    new 
szMenuStr64 ];
    
g_iQuestionid ] = randomsizeof g_szQuestions);
    
formatszMenuStrcharsmaxszMenuStr ), "\y%s"g_szQuestionsg_iQuestionid ] ] );
    new 
menu menu_createszMenuStr"handleQuestion" );
    
    
menu_additemmenu"Yes""1");
    
menu_additemmenu"No""2");
    
    
menu_setpropmenuMPROP_EXITMEXIT_NEVER );
    
menu_displayidmenu); 
}

public 
handleQuestionidmenuitem )
{
    new 
data], szName32 ];
    new 
accesscallback;
    
menu_item_getinfomenuitemaccessdatacharsmaxdata ), szNamecharsmaxszName ), callback );
    
    new 
key str_to_numdata );
    
    if( 
key != g_iAnswersg_iQuestionid ] ] )
    {
        
server_cmd"kick #%d ^"You failed to answer the question correctly^""id );
    } 
So basically I am gonna continue like that, but I want people to only answer 1 question when they join.
And how do I change the answer?

EDIT:

Should it be like that.

EDIT:

I get 8 errors with the code you showed,epic

Last edited by Exolent[jNr]; 07-28-2011 at 21:19. Reason: Triplepost.
ajjt 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 01:11.


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