Objectives remover

Started by xPaw mapper
03/07/2009 22:02
Page 1 of 1
xPaw mapper03/07/2009 22:02(edited 09/08/2011 18:44)

Description
“Avatar” asked me if i can do such plugin, and voula ;)

This plugin simply removes objectives from map ( hostages, vips, bombs, escapes ), wich means round will never end, until you die ofcourse :)

Avatar03/07/2009 22:04

ubernice plugin for pll who play longer times on their lanservers (geeking tjs), becouse the restarts after 9 minutes are ubergay..
really well done xPaw

SchlumPF03/07/2009 22:33(edited 03/07/2009 22:40)

// edit: nvm, just checked again whetehr this is faster but it isnt. i though remove_entity_name() is run by c++ code (1native call per classname) but it is just a stock (multiple native calls per classname).

your ugly xPaw (<3 !!1), reason for your stupidity ->


#include
#include

#pragma semicolon 1

public plugin_init( )
{
register_plugin( "Objectives Remover", "1.0", "" );

new const remove[][] =
{
"func_bomb_target",
"info_bomb_target",
"hostage_entity",
"func_hostage_rescue",
"info_hostage_rescue",
"info_vip_start",
"func_vip_safetyzone",
"func_escapezone",
"game_player_equip",
"player_weaponstrip",
"info_player_deathmatch",
"info_map_parameters"
};

for( new i; i < sizeof( remove ); i++ )
{
remove_entity_name( remove );
}
}

xPaw mapper03/07/2009 22:40

Ey stfu, remove_entity_name is stock too, same with while loop, so you fail !

SchlumPF04/07/2009 01:39

i already explained why i am wrong, but still, remove_entity_name() is more readable (just compare our codes ;D).

doktor04/07/2009 08:37(edited 04/07/2009 08:57)

I prefer to alter classnames, so you can re-enable objectives w/o having to change the map.

My way :

#include 
#include
#include
#include
#include

#define VERSION "0.0.4"

#define m_iHideHUD 361
#define m_iClientHideHUD 362
#define m_pClientActiveItem 374
#define HIDEHUD_TIMER (1<<4)

new const g_szObjectivesClasses[][] = {
"func_bomb_target",
"info_bomb_target",
"hostage_entity",
"monster_scientist",
"func_hostage_rescue",
"info_hostage_rescue",
"info_vip_start",
"func_vip_safetyzone",
"func_escapezone"
};

new const g__szObjectivesClasses[][] = {
"_func_bomb_target",
"_info_bomb_target",
"_hostage_entity",
"_monster_scientist",
"_func_hostage_rescue",
"_info_hostage_rescue",
"_info_vip_start",
"_func_vip_safetyzone",
"_func_escapezone"
};

new sv_restartround;
new g_bNoObjectives;

public plugin_init()
{
register_plugin("No Objectives", VERSION, "ConnorMcLeod");

register_concmd("objectives_hide", "ConsoleCommand_Hide", ADMIN_CFG);
register_concmd("objectives_show", "ConsoleCommand_Show", ADMIN_CFG);

register_event("HideWeapon", "Event_HideWeapon", "be");
register_event("ResetHUD", "Event_ResetHUD", "be");

sv_restartround = get_cvar_pointer("sv_restartround");
}

public ConsoleCommand_Hide(id, level, cid)
{
if( !cmd_access(id, level, cid, 1) )
{
return PLUGIN_HANDLED;
}

if( g_bNoObjectives )
{
return PLUGIN_HANDLED;
}

g_bNoObjectives = true;

for(new i; i {
Change_Ent_Classname(g_szObjectivesClasses, g__szObjectivesClasses);
}

set_pcvar_float(sv_restartround, 1.0);

return PLUGIN_HANDLED;
}

public ConsoleCommand_Show(id, level, cid)
{
if( !cmd_access(id, level, cid, 1) )
{
return PLUGIN_HANDLED;
}

if( !g_bNoObjectives )
{
return PLUGIN_HANDLED;
}

g_bNoObjectives = false;

for(new i; i {
Change_Ent_Classname(g__szObjectivesClasses, g_szObjectivesClasses);
}

set_pcvar_float(sv_restartround, 1.0);

return PLUGIN_HANDLED;
}

Change_Ent_Classname(szOldClassName[], szNewClassname[])
{
new iEnt;
while( (iEnt = find_ent_by_class(iEnt, szOldClassName)) > 0 )
{
entity_set_string(iEnt, EV_SZ_classname, szNewClassname);
}
}

public Event_HideWeapon(id)
{
if( g_bNoObjectives && read_data(1) & HIDEHUD_TIMER )
{
set_pdata_cbase(id, m_pClientActiveItem, FM_NULLENT);
}
}

public Event_ResetHUD(id)
{
if( g_bNoObjectives )
{
set_pdata_int(id, m_iClientHideHUD, 0);
set_pdata_int(id, m_iHideHUD, HIDEHUD_TIMER);
}
}

spr1n mapper04/07/2009 12:10

search wins: http://forums.alliedmods.net/showthread.php?t=53812

but oh well, doktor's way is sexy

st0ka04/07/2009 13:02

Originally posted by spr1n
search wins: http://forums.alliedmods.net/showthread.php?t=53812

but oh well, doktor's way is sexy

I've been using that plugin for like 2 years already. Back in the days when I used to jump and especially trickjump, the round end really bothered me. Who would've thought the guys nowadays can't find it on alliedmods or have they even tried to? =D

Page 1 of 1

Please log in to post replies.