View Single Post
Snake.
Senior Member
Join Date: Jul 2017
Old 05-20-2019 , 01:57   Re: [Req] Deathrun Freerun ( please read )
Reply With Quote #8

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. is offline
Send a message via Skype™ to Snake.