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

deathrun used buttons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 04-16-2022 , 12:12   deathrun used buttons
Reply With Quote #1

hi there, i've got this free round plugin by xPaw without the vote, but the problem is that the Terr is able to use all the traps, and then type /free, and the free round starts... can anyone edit that, as the trapped used one trap/one button, he isn't able to start a free round! Thank you!
PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < colorchat >

const m_toggle_state 41;

new 
bool:g_bFreeRound;

new 
g_synced;

public 
plugin_init() {
    
register_plugin"Free Round without Vote""1.0""xPaw" ); 
    
    
register_clcmd"say /free""CmdFreeRound" );
    
register_clcmd"say /freeround""CmdFreeRound" );
    
    
RegisterHamHam_Use"func_rot_button""FwdHamUse_Button" );
    
RegisterHamHam_Use"func_button",     "FwdHamUse_Button" );
    
RegisterHamHam_Use"button_target",   "FwdHamUse_Button" );
    
    
register_event"CurWeapon""EventCurWeapon""be""1=1""2!29" );
    
register_event"HLTV",      "EventNewRound",  "a",  "1=0""2=0" );
    
register_event"TextMsg",   "EventRestart",   "a",  "2&#Game_C""2&#Game_w" );
    
    
g_synced CreateHudSyncObj( );
}
public 
EventNewRound( ) {
    if( 
g_bFreeRound ) {
        
g_bFreeRound false;
        return;
    }
}
public 
EventRestart( ) {
    
g_bFreeRound false;
}
public 
EventCurWeaponid ) {
    if( 
g_bFreeRound ) {
        
engclient_cmdid"weapon_knife" );
        
ColorChatidRED"^4[Free Round]^1 Free Round = No traps, No weapons." );
    }
}
public 
CmdFreeRoundid ) {
    if( 
cs_get_user_teamid ) != CS_TEAM_T ) {
        
ColorChatidRED"^4[Free Round]^1 Only trappers have access to this command!");
        
        return 
PLUGIN_CONTINUE;
    }
    else if( 
g_bFreeRound ) {
        
ColorChatidRED"^4[Free Round]^1 It is already a free round!");
        
        return 
PLUGIN_CONTINUE;
    }
    new 
szName32 ];
    
get_user_nameidszNamecharsmaxszName ) )
    
    
set_hudmessage255255155, -1.00.1510.51.00.515.0, -1)
    
ShowSyncHudMsg0g_synced"- Free Round -^nNo traps, No weapons" );
    
    
ColorChat0RED"^4[Free Round]^1 Free round has been started by^4 %s"szName );
    
    
g_bFreeRound true;
    
    return 
PLUGIN_CONTINUE;
}
public 
FwdHamUse_ButtoniEntityidiActivatoriUseTypeFloat:flValue ) {
    if( 
g_bFreeRound && iUseType == && flValue == 1.0 && is_user_aliveid )
    &&  
get_user_teamid ) == && get_pdata_intiEntitym_toggle_state) == ) {
        
        
ColorChatidRED"^4[Free Round]^1 Free Round = No traps, No weapons." );
        
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;

__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
fingerprint
Junior Member
Join Date: Apr 2022
Old 04-16-2022 , 16:00   Re: deathrun used buttons
Reply With Quote #2

Can you explain what you exactly want to do ?
Terrorist will not be able to start free round ?
fingerprint is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 04-16-2022 , 16:09   Re: deathrun used buttons
Reply With Quote #3

this plugin let terrorists start a free round, free round means terro can't use traps, and ct cant use weapons, but the thing is that terro can use all the traps and then simple type /free and free round starts, and ct can't use any weapon, and if there can be like, if the terro used one trap, he wouldn't be able to start free round anymore!
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-28-2023 , 11:10   Re: deathrun used buttons
Reply With Quote #4

bump
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
zXCaptainXz
Member
Join Date: May 2017
Old 01-28-2023 , 11:48   Re: deathrun used buttons
Reply With Quote #5

Good news, it compiles!
Bad news, sorry I didn't test it...

PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < colorchat >

const m_toggle_state 41;

new 
bool:g_bFreeRound;
new 
bool:g_bBlocked;

new 
g_synced;

public 
plugin_init() {
    
register_plugin"Free Round without Vote""1.0""xPaw" ); 
    
    
register_clcmd"say /free""CmdFreeRound" );
    
register_clcmd"say /freeround""CmdFreeRound" );
    
    
RegisterHamHam_Use"func_rot_button""FwdHamUse_Button" );
    
RegisterHamHam_Use"func_button",     "FwdHamUse_Button" );
    
RegisterHamHam_Use"button_target",   "FwdHamUse_Button" );
    
    
register_event"CurWeapon""EventCurWeapon""be""1=1""2!29" );
    
register_event"HLTV",      "EventNewRound",  "a",  "1=0""2=0" );
    
register_event"TextMsg",   "EventRestart",   "a",  "2&#Game_C""2&#Game_w" );
    
    
g_synced CreateHudSyncObj( );
}
public 
EventNewRound( ) {
    
g_bFreeRound false;
    
g_bBlocked false;
}
public 
EventRestart( ) {
    
g_bFreeRound false;
}

public 
EventCurWeaponid ) {
    if( 
g_bFreeRound ) {
        
engclient_cmdid"weapon_knife" );
        
ColorChatidRED"^4[Free Round]^1 Free Round = No traps, No weapons." );
    }
}
public 
CmdFreeRoundid ) {
    if( 
cs_get_user_teamid ) != CS_TEAM_T ) {
        
ColorChatidRED"^4[Free Round]^1 Only trappers have access to this command!");
        
        return 
PLUGIN_CONTINUE;
    }
    else if(
g_bBlocked){
        
ColorChatidRED"^4[Free Round]^1 You have already activated a trap!");        
        return 
PLUGIN_CONTINUE;
    }
    else if( 
g_bFreeRound ) {
        
ColorChatidRED"^4[Free Round]^1 It is already a free round!");
        
        return 
PLUGIN_CONTINUE;
    }
    new 
szName32 ];
    
get_user_nameidszNamecharsmaxszName ) )
    
    
set_hudmessage255255155, -1.00.1510.51.00.515.0, -1)
    
ShowSyncHudMsg0g_synced"- Free Round -^nNo traps, No weapons" );
    
    
ColorChat0RED"^4[Free Round]^1 Free round has been started by^4 %s"szName );
    
    
g_bFreeRound true;
    
    return 
PLUGIN_CONTINUE;
}
public 
FwdHamUse_ButtoniEntityidiActivatoriUseTypeFloat:flValue ) {
    if(!
g_bBlocked&&iUseType == && flValue == 1.0 && is_user_aliveid )
    &&  
get_user_teamid ) == && get_pdata_intiEntitym_toggle_state) == ) {
        if(
g_bFreeRound){
            
ColorChatidRED"^4[Free Round]^1 Free Round = No traps, No weapons." );            
            return 
HAM_SUPERCEDE;
        }
        
g_bBlocked true;        
    }

    return 
HAM_IGNORED;

zXCaptainXz is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 01-28-2023 , 22:11   Re: deathrun used buttons
Reply With Quote #6

PHP Code:
// INCLUDES
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <colorchat>

new bool:g_bFreeRound,
    
bool:g_bUsedButton,
    
g_synced

public plugin_init()
{
    
register_plugin"Free Round without Vote""1.0""xPaw" ); 
    
register_clcmd"say /free""CmdFreeRound" )
    
register_clcmd"say /freeround""CmdFreeRound" )
    
    
RegisterHamHam_Use"func_rot_button""FwdHamUse_Button" )
    
RegisterHamHam_Use"func_button",     "FwdHamUse_Button" )
    
RegisterHamHam_Use"button_target",   "FwdHamUse_Button" )
    
    
register_event"CurWeapon""EventCurWeapon""be""1=1""2!29" )
    
register_event"HLTV",      "EventNewRound",  "a",  "1=0""2=0" )
    
register_event"TextMsg",   "EventRestart",   "a",  "2&#Game_C""2&#Game_w" )
    
    
g_synced CreateHudSyncObj( )
}


public 
EventNewRound( ) {
    
g_bFreeRound false
    g_bUsedButton 
false
}

public 
EventRestart( ) {
    
g_bFreeRound false
    g_bUsedButton 
false
}

public 
EventCurWeaponid ) {
    if(!
g_bFreeRound)
        return
    
    
engclient_cmdid"weapon_knife" )
    
ColorChatidRED"^4[Free Round]^1 Free Round = No traps, No weapons." )
}

public 
CmdFreeRoundid ) {
    if( 
g_bUsedButton ) {
        
ColorChatidRED"^4[Free Round]^1 You have already used a trap, you cannot do a free round anymore!")
        return 
PLUGIN_HANDLED
    
}

    if( 
g_bFreeRound ) {
        
ColorChatidRED"^4[Free Round]^1 It is already a free round!")
        return 
PLUGIN_HANDLED
    
}
    
    if( 
cs_get_user_teamid ) != CS_TEAM_T ) {
        
ColorChatidRED"^4[Free Round]^1 Only trappers have access to this command!")
        
        return 
PLUGIN_HANDLED
    
}

    new 
szName32 ]
    
get_user_nameidszNamecharsmaxszName ) )
    
    
set_hudmessage255255155, -1.00.1510.51.00.515.0, -1)
    
ShowSyncHudMsg0g_synced"- Free Round -^nNo traps, No weapons" )
    
    
ColorChat0RED"^4[Free Round]^1 Free round has been started by^4 %s"szName )
    
    
g_bFreeRound true
    
    
return PLUGIN_CONTINUE
}

public 
FwdHamUse_ButtoniEntityidiActivatoriUseTypeFloat:flValue ) {
    if ( 
cs_get_user_team(id) != CS_TEAM_CT) {
        if ( !
g_bUsedButton && !g_bFreeRound) {
            
g_bUsedButton true
            ColorChat
idRED"^4[Free Round]^1 You lost your privilege to call for a free round." )
            return 
HAM_IGNORED
        
} else if ( g_bFreeRound ) {
            
ColorChatidRED"^4[Free Round]^1 Free Round = No traps, No weapons." )
            return 
HAM_SUPERCEDE
        
}
    }

    return 
HAM_IGNORED

__________________

Last edited by deprale; 01-28-2023 at 22:17.
deprale is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-29-2023 , 12:13   Re: deathrun used buttons
Reply With Quote #7

thank you both!
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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 22:00.


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