Senior Member
|
05-23-2019
, 14:36
Re: [Req] Deathrun Freerun ( please read )
|
#9
|
Quote:
Originally Posted by Snake.
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(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "fwdSpawn", 1);
RegisterHam( Ham_Touch, "armoury_entity", "FwdHamPlayerPickup" );
RegisterHam( Ham_Touch, "weaponbox", "FwdHamPlayerPickup" );
RegisterHam( Ham_Use, "func_rot_button", "FwdHamUse_Button" );
RegisterHam( Ham_Use, "func_button", "FwdHamUse_Button" );
RegisterHam( Ham_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_print( 0 , print_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 ChooseOption( client )
{
/*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_print( client , print_chat , "It is free round already!" );
return PLUGIN_HANDLED;
}
new szMenu[ 64 ];
formatex ( szMenu, charsmax ( szMenu ), "Choose Your Option" )
//new szMenu = menu_create("Choose Your Option", "FreeHandler");
new Menu = menu_create( szMenu, "FreeHandler" )
menu_additem( Menu, "\wFree Round", "", 0);
menu_additem( Menu, "\wNormal Round", "", 1);
menu_display( client, Menu )
return 1;
}
public FreeHandler( client, Menu, item )
{
if ( item == MENU_EXIT )
{
menu_destroy ( Menu );
return 1;
}
if( FreeRound )
{
client_print( client , print_chat , "It is free round already!" );
return PLUGIN_HANDLED;
}
switch ( item )
{
case 0:
{
new szName[ 32 ];
get_user_name( client, szName, charsmax ( szName ));
set_hudmessage( 210, 30, 5, 0.03, 0.27, 0, 6.0, 5.0 );
show_hudmessage( 0, "%s Choosed Free Round !!", szName);
client_print( 0 , print_chat , "%s Started Free Round", szName );
CmdFree( client );
}
case 1:
{
new szName[ 32 ];
get_user_name( client, szName, charsmax ( szName ));
set_hudmessage( 210, 30, 5, 0.03, 0.27, 0, 6.0, 5.0 );
show_hudmessage( 0, "%s choosed normal round !!", szName );
client_print( 0 , print_chat , "%s started normal round", szName );
CmdNormal( client );
}
}
return PLUGIN_HANDLED;
}
public CmdFree( client )
{
fm_strip_user_weapons( client );
fm_give_item( client, "weapon_knife" );
FreeRound = true;
}
public CmdNormal( client )
{
FreeRound = false;
}
public FwdHamUse_Button( iEntity, client, iActivator, iUseType, Float:flValue )
{
if( FreeRound && iUseType == 2 && flValue == 1.0 && is_user_alive( client )
&& fm_get_user_team( client ) == 1 && get_pdata_int( iEntity, m_toggle_state, 4 ) == 1 )
{
set_hudmessage( random(255), random(255), random(255), -1.0, 0.25, 0, 2.0, 2.0, 0.2, 0.2, 3 );
show_hudmessage( client, "It is free round!^nYou can't use buttons!" );
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public FwdHamPlayerPickup( iEntity, client )
{
if ( is_user_connected( client ) && FreeRound )
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
stock fm_get_user_team( client )
{
return get_pdata_int( client, 114 );
}
stock fm_set_user_team(client, team)
{
set_pdata_int( client, 114, team );
static const TeamInfo[ Teams ][] =
{
"UNASSIGNED",
"TERRORIST",
"CT",
"SPECTATOR"
};
message_begin( MSG_ALL, get_user_msgid( "TeamInfo" ) ) ;
write_byte( client );
write_string( TeamInfo[ team ] );
message_end( );
}
|
Bump
|
|