Raised This Month: $ Target: $400
 0% 

Ham_Spawn - bad; FM_Spawn - good; Why?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-01-2009 , 23:39   Ham_Spawn - bad; FM_Spawn - good; Why?
Reply With Quote #1

Ham_Spawn:
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < engine >
#include < hamsandwich >

public plugin_precache()
{
    new 
iEntity create_entity"player_weaponstrip" );
    
DispatchKeyValueiEntity"targetname""stripper" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"game_player_equip" );
    
DispatchKeyValueiEntity"weapon_knife""1" );
    
DispatchKeyValueiEntity"targetname""equipment" );
    
    
iEntity create_entity"multi_manager" );
    
DispatchKeyValueiEntity"stripper""0" );
    
DispatchKeyValueiEntity"equipment""0.5" );
    
DispatchKeyValueiEntity"targetname""game_playerspawn" );
    
DispatchKeyValueiEntity"spawnflags""1" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"info_map_parameters" );
    
DispatchKeyValueiEntity"buying""3" );
    
DispatchSpawniEntity );
    
    new const 
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",
        
"info_map_parameters",
        
"player_weaponstrip",
        
"game_player_equip",
        
"func_buyzone"
    
};
    
    for( new 
0sizeofsRemoveEntities ); i++ )
    {
        
RegisterHamHam_SpawnsRemoveEntities], "FwdSpawn" );
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
pfn_keyvalueiEntity )
{
    static 
szClassname32 ], szKey32 ], szValue32 ];
    
copy_keyvalueszClassname31szKey31szValue31 );
    
    if( 
equalszClassname"multi_manager" )
    && 
equalszKey"targetname" )
    && 
equalszValue"game_playerspawn" ) )
    {
        
remove_entityiEntity );
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
FwdSpawniEntity )
{
    
remove_entityiEntity );
    
    return 
HAM_SUPERCEDE;

FM_Spawn:
PHP Code:
#include < amxmodx >
#include < amxmisc >
#include < engine >
#include < fakemeta >

new Trie:g_tRemoveEntities;

public 
plugin_precache()
{
    new 
iEntity create_entity"player_weaponstrip" );
    
DispatchKeyValueiEntity"targetname""stripper" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"game_player_equip" );
    
DispatchKeyValueiEntity"weapon_knife""1" );
    
DispatchKeyValueiEntity"targetname""equipment" );
    
    
iEntity create_entity"multi_manager" );
    
DispatchKeyValueiEntity"stripper""0" );
    
DispatchKeyValueiEntity"equipment""0.5" );
    
DispatchKeyValueiEntity"targetname""game_playerspawn" );
    
DispatchKeyValueiEntity"spawnflags""1" );
    
DispatchSpawniEntity );
    
    
iEntity create_entity"info_map_parameters" );
    
DispatchKeyValueiEntity"buying""3" );
    
DispatchSpawniEntity );
    
    new const 
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",
        
"info_map_parameters",
        
"player_weaponstrip",
        
"game_player_equip",
        
"func_buyzone"
    
};
    
    
g_tRemoveEntities TrieCreate( );
    
    for( new 
0sizeofsRemoveEntities ); i++ )
    {
        
TrieSetCellg_tRemoveEntitiessRemoveEntities], );
    }
    
    
register_forwardFM_Spawn"FwdSpawn" );
    
    return 
PLUGIN_CONTINUE;
}

public 
plugin_end()
{
    
TrieDestroyg_tRemoveEntities );
}

public 
pfn_keyvalueiEntity )
{
    static 
szClassname32 ], szKey32 ], szValue32 ];
    
copy_keyvalueszClassname31szKey31szValue31 );
    
    if( 
equalszClassname"multi_manager" )
    && 
equalszKey"targetname" )
    && 
equalszValue"game_playerspawn" ) )
    {
        
remove_entityiEntity );
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
FwdSpawniEntity )
{
    static 
szClassname32 ];
    
entity_get_stringiEntityEV_SZ_classnameszClassname31 );
    
    if( 
TrieKeyExistsg_tRemoveEntitiesszClassname ) )
    {
        
remove_entityiEntity );
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

The problem is that when I use Ham_Spawn version, it deletes the spawn points or something because there are none anymore and when you join the server, you can't choose a team because they are full, even though there are no players. Also, your camera when you join is somewhere in the wall or random in the map. But, when I use FM_Spawn, everything works perfectly.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
 


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


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