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
ajjt
Junior Member
Join Date: Jul 2011
Old 07-27-2011 , 08:22   need help with amxx scripting, would appreciate if you would help me
Reply With Quote #1

Hi everybody

I am working with my first amx mod x plugin.
And I was asking how I can make a plugin that ask a question about the rules example, "Is team kill allowed" and the option is gonna be yes or no, so if they answer wrong they will be kicked and banned 2min from the server. The question should be different. I hope someone give me idea how I could make it.

Best regards ajjt

Last edited by ajjt; 07-27-2011 at 08:35.
ajjt is offline
ajjt
Junior Member
Join Date: Jul 2011
Old 07-27-2011 , 08:37   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #2

I would appreciate if you told how to do it.
ajjt is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-27-2011 , 09:10   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #3

I would appreciate if no one would never do this plugin.
SnoW is offline
Send a message via MSN to SnoW
ajjt
Junior Member
Join Date: Jul 2011
Old 07-27-2011 , 09:14   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #4

Quote:
Originally Posted by SnoW View Post
I would appreciate if no one would never do this plugin.
This is my first plugin that I am making, that's way it's a easy plugin.
And the problem is how can they get random question and if they answer wrong they will be kicked and banned 2min
ajjt is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 07-27-2011 , 09:23   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #5

Could you write some code and ask something more specific because I am pretty sure you will find how to kick and ban a player. Anyway for random number use this and create the menu you show the question in with the help of this.
SnoW is offline
Send a message via MSN to SnoW
Old 07-27-2011, 09:26
ajjt
This message has been deleted by ajjt. Reason: find answer
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-27-2011 , 09:24   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #7

You need a list of questions and a list of answers, each in their own string variable, in corresponding order. It then depends on what kind of ban system your running ... AmxBans? AdvancedBans? ...? Otherwise just stick with kick.
hornet is offline
ajjt
Junior Member
Join Date: Jul 2011
Old 07-27-2011 , 09:28   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #8

Quote:
Originally Posted by hornet View Post
You need a list of questions and a list of answers, each in their own string variable, in corresponding order. It then depends on what kind of ban system your running ... AmxBans? AdvancedBans? ...? Otherwise just stick with kick.
What do you mean with "their own string variable, in corresponding order"
ajjt is offline
ajjt
Junior Member
Join Date: Jul 2011
Old 07-27-2011 , 10:04   Re: need help with amxx scripting, would appreciate if you would help me
Reply With Quote #9

Quote:
Originally Posted by hornet View Post
You need a list of questions and a list of answers, each in their own string variable, in corresponding order. It then depends on what kind of ban system your running ... AmxBans? AdvancedBans? ...? Otherwise just stick with kick.
Can you show a example how it should be like?
ajjt is offline
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 #10

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
Reply


Thread Tools
Display Modes

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