AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Hostages Hats [Solved] (https://forums.alliedmods.net/showthread.php?t=106206)

dFF 10-12-2009 10:48

[HELP] Hostages Hats [Solved]
 
code:
PHP Code:

#include <amxmodx> 
#include <engine>

#define hat "models/admin_head.mdl"

public plugin_precache()
{
    
precache_model(hat)
}

public 
plugin_init() 
{    
    if(
find_ent_by_class(-1"hostage_entity"))
    {
        
register_event("HLTV""event_new_round""a""1=0""2=0")
    }
}

public 
event_new_round()
{
    new 
iEnt find_ent_by_class(-1"hostage_entity")
    
    while(
iEnt 0)
    {
        
entity_set_int(iEntEV_INT_movetypeMOVETYPE_FOLLOW)
        
entity_set_edict(iEntEV_ENT_aimentiEnt)
        
entity_set_model(iEnthat)
        
iEnt find_ent_by_class(iEnt"hostage_entity")
    }


error: http://img240.**************/i/hostage.png/ or http://i35.tinypic.com/1gndjo.png


I tried to put a hat hostages but did not work
Thanks for help:)

xPaw 10-12-2009 14:14

Re: [HELP] Hostages Hats
 
The hats on hostages are completely bugged, but here is working version

PHP Code:

#include < amxmodx >
#include < engine >

new const g_szHat[ ] = "models/jamaicahat.mdl";

public 
plugin_init( ) {
    
register_plugin"Hostages Hats""1.0""xPaw" );
    
    new 
iEntitybool:bFound;
    
    while( ( 
iEntity find_ent_by_classiEntity"hostage_entity" ) ) > ) {
        if( !
bFound ) {
            
bFound true;
            
            
register_event"HLTV""EventNewRound""a""1=0""2=0" );
        }
        
        
CreateHatiEntity );
    }
}

public 
plugin_precache( )
    
precache_modelg_szHat );

public 
EventNewRound( ) {
    new 
iEntity;
    
    while( ( 
iEntity find_ent_by_classiEntity"hostage_entity" ) ) > )
        if( !
is_valid_ententity_get_intiEntityEV_INT_iuser1 ) ) )
            
CreateHatiEntity );
}

CreateHat( const iHostage ) {
    new 
iEntity create_entity"info_target" );
    
    if( !
is_valid_entiEntity ) )
        return 
0;
    
    
entity_set_intiHostageEV_INT_iuser1iEntity );
    
entity_set_intiEntityEV_INT_movetypeMOVETYPE_FOLLOW );
    
entity_set_edictiEntityEV_ENT_aimentiHostage );
    
entity_set_modeliEntityg_szHat );
    
    return 
iEntity;



dFF 10-14-2009 11:19

Re: [HELP] Hostages Hats
 
thank you +k

if you could help me out here http://forums.alliedmods.net/showthread.php?t=106356 ..
if you want


All times are GMT -4. The time now is 22:40.

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