AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Req] Deathrun Freerun ( please read ) (https://forums.alliedmods.net/showthread.php?t=316304)

Snake. 05-16-2019 09:40

[Req] Deathrun Freerun ( please read )
 
I know there are so many free run plugin but none of them is not like i want.

Every round start, a menu choice will pop up to terrorists:

Freerun?

1-Yes
2-No

If yes, terrorists wont be able to open the traps
and cts wont be able to kill terrorist with weapon( only can with knife and bomb ). Also "Terrorist decided to freerun" message will be shown.

If no, nothing happen."Terrorist did not want freeround" will be show.

If terrorist does not choose, menu will close after x seconds.

Fuck For Fun 05-16-2019 11:57

Re: [Req] Deathrun Freerun ( please read )
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta_util >

#define PLUGIN "DR: FreeRun VOTE"
#define VERSION "1.0"
#define AUTHOR "CheezPuff aka Fuck For Fun"

#define Counter        FM_TEAM_CT
#define Terrorist    FM_TEAM_T

const m_toggle_state 41;
new 
bool:FreeRound;

enum _:Teams // If there are any comments of why I used FM then I will fix it to CS_
{

    
FM_TEAM_UNASSIGNED,
    
FM_TEAM_T,
    
FM_TEAM_CT,
    
FM_TEAM_SPECTATOR
};

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Spawn"player""fwdSpawn"1);

    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerPickup" );
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerPickup" );
    
    
RegisterHamHam_Use"func_rot_button""FwdHamUse_Button" );
    
RegisterHamHam_Use"func_button",     "FwdHamUse_Button" );
    
RegisterHamHam_Use"button_target",   "FwdHamUse_Button" );
    
    
//register_event( "HLTV",      "EventNewRound",  "a",  "1=0", "2=0" );
}

/*public EventNewRound( )
{
    if( FreeRound )
    {
        FreeRound = false;
        
        return;
    }
    else if( g_bEnableFree )
    {
        FreeRound = true;
        
        set_task( 1.5, "PrintMessage" );
        
        return;
    }
}*/

public PrintMessage( )
{
    
client_printprint_chat "debug: It is a Free round, no guns!" );
}

public 
fwdSpawn client )
{
    if ( 
fm_get_user_team client ) == ( Terrorist )) // If there are any comments of why I used fm_get_user_team then I will fix it to cs_get_user
    
{
        
set_task 1.0"ChooseOption"client )
    }
}

public 
ChooseOptionclient )
{
    
/*if( fm_get_user_team( client ) != FM_TEAM_T ) // i forgot is already check in spawn
    {
        client_print( client , print_chat , "This command is only for terrorists!" );
        
        return PLUGIN_HANDLED;
    }*/
    
if( FreeRound )
    {
        
client_printclient print_chat "It is free round already!" );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szMenu64 ];

    
formatex szMenucharsmax szMenu ), "Choose Your Option" )
    
//new szMenu = menu_create("Choose Your Option", "FreeHandler");
    
new Menu menu_createszMenu"FreeHandler" )

    
menu_additemMenu"\wFree Round"""0); 
    
menu_additemMenu"\wNormal Round"""1); 
    
    
menu_displayclientMenu )

    return 
1;    
}

public 
FreeHandlerclientMenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy Menu );
        return 
1;
    }

    if( 
FreeRound )
    {
        
client_printclient print_chat "It is free round already!" );
        
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
item )
    {
        case 
0:    
        {
            new 
szName32 ];
            
get_user_nameclientszNamecharsmax szName ));
        
            
set_hudmessage2103050.030.2706.05.0 );
        
            
show_hudmessage0"%s Choosed Free Round !!"szName);
        
            
client_printprint_chat "%s Started Free Round"szName );
        
            
CmdFreeclient );
        }
    
        case 
1:    
        {
            new 
szName32 ];
            
get_user_nameclientszNamecharsmax szName ));
        
            
set_hudmessage2103050.030.2706.05.0 );
        
            
show_hudmessage0"%s choosed normal round !!"szName );
        
            
client_printprint_chat "%s started normal round"szName );
            
            
CmdNormalclient );
        }
    }

    return 
PLUGIN_HANDLED;
}

public 
CmdFreeclient )
{
    
fm_strip_user_weaponsclient );
    
fm_give_itemclient"weapon_knife" );

    
FreeRound true;
}

public 
CmdNormalclient )
{
    
FreeRound false;
}

public 
FwdHamUse_ButtoniEntityclientiActivatoriUseTypeFloat:flValue 
{
    if( 
FreeRound && iUseType == && flValue == 1.0 && is_user_aliveclient )
    &&  
fm_get_user_teamclient ) == && get_pdata_intiEntitym_toggle_state) == )
    {
        
set_hudmessagerandom(255), random(255), random(255), -1.00.2502.02.00.20.2);
        
show_hudmessageclient"It is free round!^nYou can't use buttons!" );
        
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
FwdHamPlayerPickupiEntityclient )
{
    if ( 
is_user_connectedclient ) && FreeRound )
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

stock fm_get_user_teamclient )
{
    return 
get_pdata_intclient114 );
}

stock fm_set_user_team(clientteam)
{
    
set_pdata_intclient114team );
    static const 
TeamInfoTeams ][] =
    {
        
"UNASSIGNED",
        
"TERRORIST",
        
"CT",
        
"SPECTATOR"
    
};

    
message_beginMSG_ALLget_user_msgid"TeamInfo" ) ) ;
    
write_byteclient );
    
write_stringTeamInfoteam ] );
    
message_end( );



iceeedr 05-16-2019 13:20

Re: [Req] Deathrun Freerun ( please read )
 
PHP Code:

set_task 1.0"ChooseOption" 

:arrow:

PHP Code:

set_task 1.0"ChooseOption"client


Snake. 05-16-2019 13:39

Re: [Req] Deathrun Freerun ( please read )
 
I test it but does not work. Menu comes but items does not work. And menu does not close after a while.

JocAnis 05-16-2019 17:56

Re: [Req] Deathrun Freerun ( please read )
 
also @Fuck For Fun where is the code to block using buttons if free round enabled?

Fuck For Fun 05-17-2019 14:16

Re: [Req] Deathrun Freerun ( please read )
 
Quote:

Originally Posted by iceeedr (Post 2651898)
PHP Code:

set_task 1.0"ChooseOption" 

:arrow:

PHP Code:

set_task 1.0"ChooseOption"client


Oh I did not notice, thank you very much !! fixed.
Quote:

Originally Posted by Snake. (Post 2651903)
I test it but does not work. Menu comes but items does not work. And menu does not close after a while.

Check it now
Quote:

Originally Posted by JocAnis (Post 2651928)
also @Fuck For Fun where is the code to block using buttons if free round enabled?

forgot, hope is work now.

Snake. 05-17-2019 14:51

Re: [Req] Deathrun Freerun ( please read )
 
Quote:

Originally Posted by Fuck For Fun (Post 2652042)
Oh I did not notice, thank you very much !! fixed.

Check it now

forgot, hope is work now.

Terrorists are still being shot by ct with weapons.Also, first round the vote came, but other rounds did not come and became full freerun.

Snake. 05-20-2019 01:57

Re: [Req] Deathrun Freerun ( please read )
 
Can someone edit this?

♡ I want both teams to pickup weapon.
♡ The choice menu comes first round. After that if free round is choosen, menu does not come again and all after rounds being free. I want menu to come every round.
♡If terrorist does not make choice in 10 secs, round will be free.( can you show the secs in menu ?)
♡In free round, both teams wont be able to damage each other with weapons.(They will only with knife and hegrenade
)
♡In normal round, both teams will be able to damage with every weapons.

Thank you all in advance.
PHP Code:

/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta_util >

#define PLUGIN "DR: FreeRun VOTE"
#define VERSION "1.0"
#define AUTHOR "CheezPuff aka Fuck For Fun"

#define Counter        FM_TEAM_CT
#define Terrorist    FM_TEAM_T

const m_toggle_state 41;
new 
bool:FreeRound;

enum _:Teams // If there are any comments of why I used FM then I will fix it to CS_
{

    
FM_TEAM_UNASSIGNED,
    
FM_TEAM_T,
    
FM_TEAM_CT,
    
FM_TEAM_SPECTATOR
};

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Spawn"player""fwdSpawn"1);

    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerPickup" );
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerPickup" );
    
    
RegisterHamHam_Use"func_rot_button""FwdHamUse_Button" );
    
RegisterHamHam_Use"func_button",     "FwdHamUse_Button" );
    
RegisterHamHam_Use"button_target",   "FwdHamUse_Button" );
    
    
//register_event( "HLTV",      "EventNewRound",  "a",  "1=0", "2=0" );
}

/*public EventNewRound( )
{
    if( FreeRound )
    {
        FreeRound = false;
        
        return;
    }
    else if( g_bEnableFree )
    {
        FreeRound = true;
        
        set_task( 1.5, "PrintMessage" );
        
        return;
    }
}*/

public PrintMessage( )
{
    
client_printprint_chat "debug: It is a Free round, no guns!" );
}

public 
fwdSpawn client )
{
    if ( 
fm_get_user_team client ) == ( Terrorist )) // If there are any comments of why I used fm_get_user_team then I will fix it to cs_get_user
    
{
        
set_task 1.0"ChooseOption"client )
    }
}

public 
ChooseOptionclient )
{
    
/*if( fm_get_user_team( client ) != FM_TEAM_T ) // i forgot is already check in spawn
    {
        client_print( client , print_chat , "This command is only for terrorists!" );
        
        return PLUGIN_HANDLED;
    }*/
    
if( FreeRound )
    {
        
client_printclient print_chat "It is free round already!" );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szMenu64 ];

    
formatex szMenucharsmax szMenu ), "Choose Your Option" )
    
//new szMenu = menu_create("Choose Your Option", "FreeHandler");
    
new Menu menu_createszMenu"FreeHandler" )

    
menu_additemMenu"\wFree Round"""0); 
    
menu_additemMenu"\wNormal Round"""1); 
    
    
menu_displayclientMenu )

    return 
1;    
}

public 
FreeHandlerclientMenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy Menu );
        return 
1;
    }

    if( 
FreeRound )
    {
        
client_printclient print_chat "It is free round already!" );
        
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
item )
    {
        case 
0:    
        {
            new 
szName32 ];
            
get_user_nameclientszNamecharsmax szName ));
        
            
set_hudmessage2103050.030.2706.05.0 );
        
            
show_hudmessage0"%s Choosed Free Round !!"szName);
        
            
client_printprint_chat "%s Started Free Round"szName );
        
            
CmdFreeclient );
        }
    
        case 
1:    
        {
            new 
szName32 ];
            
get_user_nameclientszNamecharsmax szName ));
        
            
set_hudmessage2103050.030.2706.05.0 );
        
            
show_hudmessage0"%s choosed normal round !!"szName );
        
            
client_printprint_chat "%s started normal round"szName );
            
            
CmdNormalclient );
        }
    }

    return 
PLUGIN_HANDLED;
}

public 
CmdFreeclient )
{
    
fm_strip_user_weaponsclient );
    
fm_give_itemclient"weapon_knife" );

    
FreeRound true;
}

public 
CmdNormalclient )
{
    
FreeRound false;
}

public 
FwdHamUse_ButtoniEntityclientiActivatoriUseTypeFloat:flValue 
{
    if( 
FreeRound && iUseType == && flValue == 1.0 && is_user_aliveclient )
    &&  
fm_get_user_teamclient ) == && get_pdata_intiEntitym_toggle_state) == )
    {
        
set_hudmessagerandom(255), random(255), random(255), -1.00.2502.02.00.20.2);
        
show_hudmessageclient"It is free round!^nYou can't use buttons!" );
        
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
FwdHamPlayerPickupiEntityclient )
{
    if ( 
is_user_connectedclient ) && FreeRound )
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

stock fm_get_user_teamclient )
{
    return 
get_pdata_intclient114 );
}

stock fm_set_user_team(clientteam)
{
    
set_pdata_intclient114team );
    static const 
TeamInfoTeams ][] =
    {
        
"UNASSIGNED",
        
"TERRORIST",
        
"CT",
        
"SPECTATOR"
    
};

    
message_beginMSG_ALLget_user_msgid"TeamInfo" ) ) ;
    
write_byteclient );
    
write_stringTeamInfoteam ] );
    
message_end( );



Snake. 05-23-2019 14:36

Re: [Req] Deathrun Freerun ( please read )
 
Quote:

Originally Posted by Snake. (Post 2652359)
Can someone edit this?

♡ I want both teams to pickup weapon.
♡ The choice menu comes first round. After that if free round is choosen, menu does not come again and all after rounds being free. I want menu to come every round.
♡If terrorist does not make choice in 10 secs, round will be free.( can you show the secs in menu ?)
♡In free round, both teams wont be able to damage each other with weapons.(They will only with knife and hegrenade
)
♡In normal round, both teams will be able to damage with every weapons.

Thank you all in advance.
PHP Code:

/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta_util >

#define PLUGIN "DR: FreeRun VOTE"
#define VERSION "1.0"
#define AUTHOR "CheezPuff aka Fuck For Fun"

#define Counter        FM_TEAM_CT
#define Terrorist    FM_TEAM_T

const m_toggle_state 41;
new 
bool:FreeRound;

enum _:Teams // If there are any comments of why I used FM then I will fix it to CS_
{

    
FM_TEAM_UNASSIGNED,
    
FM_TEAM_T,
    
FM_TEAM_CT,
    
FM_TEAM_SPECTATOR
};

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Spawn"player""fwdSpawn"1);

    
RegisterHamHam_Touch"armoury_entity""FwdHamPlayerPickup" );
    
RegisterHamHam_Touch"weaponbox""FwdHamPlayerPickup" );
    
    
RegisterHamHam_Use"func_rot_button""FwdHamUse_Button" );
    
RegisterHamHam_Use"func_button",     "FwdHamUse_Button" );
    
RegisterHamHam_Use"button_target",   "FwdHamUse_Button" );
    
    
//register_event( "HLTV",      "EventNewRound",  "a",  "1=0", "2=0" );
}

/*public EventNewRound( )
{
    if( FreeRound )
    {
        FreeRound = false;
        
        return;
    }
    else if( g_bEnableFree )
    {
        FreeRound = true;
        
        set_task( 1.5, "PrintMessage" );
        
        return;
    }
}*/

public PrintMessage( )
{
    
client_printprint_chat "debug: It is a Free round, no guns!" );
}

public 
fwdSpawn client )
{
    if ( 
fm_get_user_team client ) == ( Terrorist )) // If there are any comments of why I used fm_get_user_team then I will fix it to cs_get_user
    
{
        
set_task 1.0"ChooseOption"client )
    }
}

public 
ChooseOptionclient )
{
    
/*if( fm_get_user_team( client ) != FM_TEAM_T ) // i forgot is already check in spawn
    {
        client_print( client , print_chat , "This command is only for terrorists!" );
        
        return PLUGIN_HANDLED;
    }*/
    
if( FreeRound )
    {
        
client_printclient print_chat "It is free round already!" );
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
szMenu64 ];

    
formatex szMenucharsmax szMenu ), "Choose Your Option" )
    
//new szMenu = menu_create("Choose Your Option", "FreeHandler");
    
new Menu menu_createszMenu"FreeHandler" )

    
menu_additemMenu"\wFree Round"""0); 
    
menu_additemMenu"\wNormal Round"""1); 
    
    
menu_displayclientMenu )

    return 
1;    
}

public 
FreeHandlerclientMenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy Menu );
        return 
1;
    }

    if( 
FreeRound )
    {
        
client_printclient print_chat "It is free round already!" );
        
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
item )
    {
        case 
0:    
        {
            new 
szName32 ];
            
get_user_nameclientszNamecharsmax szName ));
        
            
set_hudmessage2103050.030.2706.05.0 );
        
            
show_hudmessage0"%s Choosed Free Round !!"szName);
        
            
client_printprint_chat "%s Started Free Round"szName );
        
            
CmdFreeclient );
        }
    
        case 
1:    
        {
            new 
szName32 ];
            
get_user_nameclientszNamecharsmax szName ));
        
            
set_hudmessage2103050.030.2706.05.0 );
        
            
show_hudmessage0"%s choosed normal round !!"szName );
        
            
client_printprint_chat "%s started normal round"szName );
            
            
CmdNormalclient );
        }
    }

    return 
PLUGIN_HANDLED;
}

public 
CmdFreeclient )
{
    
fm_strip_user_weaponsclient );
    
fm_give_itemclient"weapon_knife" );

    
FreeRound true;
}

public 
CmdNormalclient )
{
    
FreeRound false;
}

public 
FwdHamUse_ButtoniEntityclientiActivatoriUseTypeFloat:flValue 
{
    if( 
FreeRound && iUseType == && flValue == 1.0 && is_user_aliveclient )
    &&  
fm_get_user_teamclient ) == && get_pdata_intiEntitym_toggle_state) == )
    {
        
set_hudmessagerandom(255), random(255), random(255), -1.00.2502.02.00.20.2);
        
show_hudmessageclient"It is free round!^nYou can't use buttons!" );
        
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;
}

public 
FwdHamPlayerPickupiEntityclient )
{
    if ( 
is_user_connectedclient ) && FreeRound )
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

stock fm_get_user_teamclient )
{
    return 
get_pdata_intclient114 );
}

stock fm_set_user_team(clientteam)
{
    
set_pdata_intclient114team );
    static const 
TeamInfoTeams ][] =
    {
        
"UNASSIGNED",
        
"TERRORIST",
        
"CT",
        
"SPECTATOR"
    
};

    
message_beginMSG_ALLget_user_msgid"TeamInfo" ) ) ;
    
write_byteclient );
    
write_stringTeamInfoteam ] );
    
message_end( );



Bump


All times are GMT -4. The time now is 22:10.

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