Raised This Month: $ Target: $400
 0% 

Removing Map Objectives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-31-2013 , 09:31   Removing Map Objectives
Reply With Quote #1

Hello everybody,

I've got this code here :

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN    "Remove Map Objectives"
#define AUTHOR    ""
#define VERSION    "1.0.0"

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

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_Spawn,"fw_SpawnPost",1)
}

public 
fw_SpawnPostiEntity )
{
    new 
szClassname32 ];
    
peviEntitypev_classnameszClassnamecharsmaxszClassname ) );
    
    for( new 
0sizeof g_szObjectivesi++ )
    {
        if( 
equaliszClassnameg_szObjectives] ) )
        {
            
remove_entityiEntity );
            break;
        }
    }

It should remove the Map objectives, but it doesn't work. Any idea why?
__________________
Kia is offline
oxygen935
Veteran Member
Join Date: Jun 2012
Location: Athens, Greece
Old 05-31-2013 , 10:00   Re: Removing Map Objectives
Reply With Quote #2

try this, it works with my plugin
Code:
Code:
#include <amxmodx> #include <fakemeta> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "oxygen" new g_HostageEnt new const g_sRemoveEntities[][] = {     "func_bomb_target",     "info_bomb_target",     "hostage_entity",     "monster_scientist",     "func_hostage_rescue",     "info_hostage_rescue",     "info_vip_start",     "func_vip_safetyzone",     "func_escapezone",     "armoury_entity" } new const MAX_REMOVED_ENTITIES = sizeof(g_sRemoveEntities); public plugin_precache() {     register_forward(FM_Spawn, "fwdSpawn", 0)         new allocHostageEntity = engfunc(EngFunc_AllocString, "hostage_entity")     do     {         g_HostageEnt = engfunc(EngFunc_CreateNamedEntity, allocHostageEntity)     }     while( !pev_valid(g_HostageEnt) )         engfunc(EngFunc_SetOrigin, g_HostageEnt, Float:{0.0, 0.0, -55000.0})     engfunc(EngFunc_SetSize, g_HostageEnt, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0})     dllfunc(DLLFunc_Spawn, g_HostageEnt) } public fwdSpawn(ent) {     if( !pev_valid(ent) || ent == g_HostageEnt )     {         return FMRES_IGNORED;     }         new sClass[32];     pev(ent, pev_classname, sClass, 31);         for( new i = 0; i < MAX_REMOVED_ENTITIES; i++ )     {         if( equal(sClass, g_sRemoveEntities[i]) )         {             engfunc(EngFunc_RemoveEntity, ent);             return FMRES_SUPERCEDE;         }     }         return FMRES_IGNORED; }
__________________
Quote:
Originally Posted by quark View Post
You're a genius
Stopped any pawn work cause of university for computer science
oxygen935 is offline
Send a message via Skype™ to oxygen935
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-31-2013 , 10:03   Re: Removing Map Objectives
Reply With Quote #3

Doesn't work for me. :/

EDIT : My bad, I forgot to mention that I also want to remove the buyzone.
__________________

Last edited by Kia; 05-31-2013 at 10:08.
Kia is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-31-2013 , 10:38   Re: Removing Map Objectives
Reply With Quote #4

Reason it doesn't work is because entities compiled into the map spawn during plugin_precache().

And as for buyzones try searching it's been done before - first shot : http://forums.alliedmods.net/showthread.php?t=90932
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-31-2013 , 10:50   Re: Removing Map Objectives
Reply With Quote #5

His plugin is working in plugin_precache and thanks for the link.
Combined both plugins, works great, thanks for help.
__________________

Last edited by Kia; 05-31-2013 at 11:09.
Kia is offline
Reply



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 16:15.


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