Raised This Month: $51 Target: $400
 12% 

question game plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yunuss85
Member
Join Date: Dec 2015
Location: Istanbul
Old 04-26-2016 , 06:34   question game plugin?
Reply With Quote #1

Hello,

When the player entry, I want to ask security questions.

For example:
Question: How many bullets in the gun Deagle?

Reply:
1- 7
2- 8

Player 2 options are automatically discarded from the game.

good day,
yunuss85 is offline
yunuss85
Member
Join Date: Dec 2015
Location: Istanbul
Old 04-26-2016 , 08:34   Re: question game plugin?
Reply With Quote #2

Is it possible to plugin be done?

Last edited by yunuss85; 04-26-2016 at 08:35.
yunuss85 is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-26-2016 , 12:56   Re: question game plugin?
Reply With Quote #3

Here is simplest possible
PHP Code:
#include <amxmodx>

public client_putinserver(id)
{
    if(!
is_user_connected(id) || !is_user_bot(id))
        
set_task(3.0"SecurityQuestionMenu")
}

public 
SecurityQuestionMenuid )
{
    
    new 
menu menu_create"\rHow many bullets in the gun Deagle?:""menu_handler" );
    
    
menu_additemmenu"\w1-7""");
    
menu_additemmenu"\w2-8""");
    
    
menu_displayidmenu);
}

public 
menu_handleridmenuitem )
{
    switch( 
item )
    {
        case 
0:
        {
            
menu_destroymenu );
            return 
PLUGIN_HANDLED;
        }
        case 
1:
        {
            new 
steamid[16]
            
get_user_authid(idsteamidcharsmax(steamid))
            
server_cmd("amx_kick %s %s"steamid"Spam bot or wrong answer!")
            return 
PLUGIN_HANDLED
        
}
    }
    
    
menu_destroymenu );
    return 
PLUGIN_HANDLED;

__________________
Artifact is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 04-26-2016 , 13:13   Re: question game plugin?
Reply With Quote #4

If you want to make antibot plugin , create menu and ask question and if he doesnt answer then he's bot.

Look here:

PHP Code:
#include <amxmodx>

#define CONNECT_DELAY 8.0 //Change it to what value do you want, this is the time after the menu appears to connected player. Note: Dont put small delay (like 1.0) because player shall choose team first....
#define ABORT_TIME 8.0 //Time after the menu will auto close if player doesnt select item in menu and he will be kicked. 

new answer[33]

public 
plugin_init()
{
    
    
register_plugin("AntiBot Security""1.0""siriusmd99")
    
}

public 
client_putinserver(id) {
    
    if(
task_exists(id))
        
remove_task(id);
    
    
set_task(CONNECT_DELAY"CheckMenu"id)
    
}    


public 
CheckMenuid )
{
    
    new 
menu menu_create"\wSelect option with Red Colour:""menu_handler" );
    
    new 
num random_num(1,6)
    new 
option[12]
    for(new 
17i++){
        
formatex(optioncharsmax(option), "%sOption%d"i==num "\r" "\w"i)
        
menu_additemmenuoption"");
    }
    
answer[id] = num;
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
    
menu_displayidmenu);
    
set_task(ABORT_TIME"CheckResult"id)
    
}

public 
menu_handleridmenuitem )
{
    
    if(
answer[id] == item 1)
    {
        
menu_destroymenu );
        
answer[id] = 0;
        
client_printidprint_chat"You have passed the security question. You can play now." );
        return 
PLUGIN_HANDLED;
    }
    
    
menu_destroymenu );
    
server_cmd("kick ^"#%d^" ^"You haven't passed the security question.^"", get_user_userid(id)) 
    
return PLUGIN_HANDLED;    
    
}

public 
CheckResult(id){
    
    if(
is_user_connected(id) && answer[id])
        
server_cmd("kick ^"#%d^" ^"You haven't passed the security question.^"", get_user_userid(id))
    

What does this plugin:
After player connects (actually put in server with some delay) he gets a menu in which he is asked to select option with red colour

Like :

Select option red coloured:

1. Option1 [Wrong Answer]
2. Option2 [Wrong Answer]
3. Option3 [Right Answer]
....

Options are colored randomly with my script and for example if option 3 is red and he selects 1 , 2 or doesnt select anything then he will be kicked with the message (you can find it in script.)

Last edited by siriusmd99; 04-26-2016 at 13:18.
siriusmd99 is offline
yunuss85
Member
Join Date: Dec 2015
Location: Istanbul
Old 05-07-2016 , 01:45   Re: question game plugin?
Reply With Quote #5

siriusmd99 Thx you.

Select option red coloured:

1. Option1 [Wrong Answer]
2. Option2 [Wrong Answer]
3. Option3 [Right Answer]

I want to change below

Questions What games are you playing right now?

1. cs 1.6
2. cs go

2.select: You haven't passed the security question.
1.select: yes.. You have passed the security question. You can play now.

Can you help me?
yunuss85 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 05-07-2016 , 05:59   Re: question game plugin?
Reply With Quote #6

Yes, you can change the colour by using this :

Quote:
White - \w
Yellow - \y
Red - \r
Grey/Disabled - \d
Here is the code:

PHP Code:
#include <amxmodx>

#define CONNECT_DELAY 8.0 //Change it to what value do you want, this is the time after the menu appears to connected player. Note: Dont put small delay (like 1.0) because player shall choose team first....
#define ABORT_TIME 8.0 //Time after the menu will auto close if player doesnt select item in menu and he will be kicked. 

new answer[33]

public 
plugin_init()
{
    
    
register_plugin("AntiBot Security""1.0""siriusmd99")
    
}

public 
client_putinserver(id) {
    
    if(
task_exists(id))
        
remove_task(id);
    
    
set_task(CONNECT_DELAY"CheckMenu"id)
    
}    

public 
CheckMenuid )
{
    
    new 
menu menu_create"\wWhat game are you playing right now?""menu_handler" );
    
    
menu_additemmenu"\wCS 1.6""");
    
menu_additemmenu"\wCS:GO""");
    
    
menu_setpropmenuMPROP_EXITMEXIT_NEVER );
    
    
menu_displayidmenu);
    
answer[id] = false;
    
set_task(ABORT_TIME"CheckResult"id)
    
}

public 
menu_handleridmenuitem )
{
    if(
item==0)
    {
        
answer[id] = true;
        
client_printidprint_chat"You have passed the security question. You can play now." );
        
    }else 
CheckResult(id
    
    
menu_destroymenu );
}   

public 
CheckResult(id){
    
    if(
is_user_connected(id) && !answer[id])
        
server_cmd("kick ^"#%d^" ^"You haven't passed the security question.^"", get_user_userid(id))
    

siriusmd99 is offline
yunuss85
Member
Join Date: Dec 2015
Location: Istanbul
Old 05-07-2016 , 08:05   Re: question game plugin?
Reply With Quote #7

thank you so much.

Can we enlarge questions :

Last edited by yunuss85; 05-07-2016 at 10:29.
yunuss85 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:31.


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