Raised This Month: $51 Target: $400
 12% 

Add entity in map


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-15-2009 , 07:23   Re: Add entity in map
Reply With Quote #11

Try this :

If you want to only remove rain sound and not thunder one, you have to filter ambient_sound entities by EV_SZ_message, and to not remove trigger_multiple entities.

PHP Code:
#include <amxmodx>
#include <engine>

#define REMOVE_THUNDER

public plugin_init()
{
    new 
szMapName[10]
    
get_mapname(szMapNamecharsmax(szMapName))
    if( 
equali(szMapName"de_aztec") )
    {
#if defined REMOVE_THUNDER
        
remove_all_ents("env_rain")
        
remove_all_ents("ambient_generic")
        
remove_all_ents("trigger_multiple")
    }
}

remove_all_ents(const szClassName[])
{
    new 
iEnt
    
while( (iEnt find_ent_by_class(iEntszClassName)) > )
    {
        
remove_entityiEnt )
    }
}
#else
    
new iEnt
    
while( (iEnt find_ent_by_class(iEnt"env_rain")) > )
    {
        
remove_entityiEnt )
    }

    new 
szMessage[32]
    while( (
iEnt find_ent_by_class(iEnt"ambient_generic")) > )
    {
        
entity_get_string(iEntEV_SZ_messageszMessagecharsmax(szMessage))
        if( 
equal(szMessage"ambience/rain.wav") )
        {
            
remove_entityiEnt )
        }
    }
}
#endif 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-15-2009 at 07:27.
ConnorMcLeod is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-16-2009 , 00:52   Re: Add entity in map
Reply With Quote #12

Quote:
Originally Posted by KadiR View Post
ambient_generic should work fine, and try also trigger_multiple, it makes the big thunder sound on the bridge and more..
Not work .
Triggers and other sounds — it is not necessary, need to delete only background sounds of rain.

Quote:
Originally Posted by xPaw View Post
Did you tryed in plugin_init? Because it will fail if you try in plugin_precache
Of course, in plugin_init.

Quote:
Originally Posted by ConnorMcLeod View Post
Try this :
Not work too @_@.
This deletes env_rain only...
Phant is offline
Send a message via ICQ to Phant
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-16-2009 , 01:25   Re: Add entity in map
Reply With Quote #13

Working :

PHP Code:
#include <amxmodx>
#include <engine>

new bool:g_bAztec

public plugin_precache()
{
    new 
szMapName[10]
    
get_mapname(szMapNamecharsmax(szMapName))
    if( 
equali(szMapName"de_aztec") )
    {
        
g_bAztec true
    
}
}

public 
pfn_keyvalueiEnt 
{
    if( !
g_bAztec )
    {
        return 
PLUGIN_CONTINUE
    
}

    new 
szClass[18], szKey[9], szValue[18]
    
copy_keyvalue(szClasscharsmax(szClass), szKeycharsmax(szKey), szValuecharsmax(szValue)) 
    if( 
equal(szClass"env_rain") )
    {
        
remove_entity(iEnt)
        return 
PLUGIN_HANDLED
    
}
    else if(    
equal(szClass"ambient_generic")
        &&    
equal(szKey"message")
        &&    
equal(szValue"ambience/rain.wav")    )
    {
        
remove_entity(iEnt)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 11-16-2009 , 04:28   Re: Add entity in map
Reply With Quote #14

Yes, thanks!
Phant is offline
Send a message via ICQ to Phant
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 01-02-2010 , 22:39   Re: Add entity in map
Reply With Quote #15

I added model with 2 skins & now I am necessary to choose skin #2, try:
Code:
new ent_cross = create_entity("cycler_sprite")
entity_set_origin(ent_cross, Float:{341.0, 2267.0, -80.0})
entity_set_model(ent_cross, "models/cross.mdl")
entity_set_int(ent_cross, EV_INT_skin, 2)
//entity_set_int(ent_cross, EV_INT_sequence, 2)
Not work? Why? Sequence work !
Model 100% with two skins.

Oh, this funny. I use:
Code:
entity_set_int(ent_cross, EV_INT_skin, 1)
This work! 0 = #1 Skin, 1 = #2 Skin, etc.

Last edited by Phant; 01-03-2010 at 01:14.
Phant is offline
Send a message via ICQ to Phant
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-03-2010 , 04:50   Re: Add entity in map
Reply With Quote #16

Yes the index starts to 0 ; the same for all generally.
__________________
Arkshine is offline
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 01-04-2010 , 04:02   Re: Add entity in map
Reply With Quote #17

Quote:
Originally Posted by Arkshine View Post
Yes the index starts to 0 ; the same for all generally.
Thansk, can u help me in this problem?
Phant is offline
Send a message via ICQ to Phant
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 02-23-2010 , 02:02   Re: Add entity in map
Reply With Quote #18

Can I add simple "trigger_camera" in map? For players after connected set view from this camera?

Problem solved:
Code:
        new en_cam = create_entity("info_target") 
        if (en_cam) {
        DispatchKeyValue(en_cam,"origin","228 680 200")
        DispatchKeyValue(en_cam,"targetname","entbug")
        DispatchSpawn(en_cam) 
        entity_set_string(en_cam, EV_SZ_classname, "info_target")
        }
        
        new entity = create_entity("trigger_camera") 
        if (entity) { 
        DispatchKeyValue(entity,"classname","trigger_camera") 
        DispatchKeyValue(entity,"flags","szHolder") 
        DispatchKeyValue(entity,"origin","60 444 290")
        DispatchKeyValue(entity,"acceleration",0) 
        DispatchKeyValue(entity,"deceleration",0) 
        DispatchKeyValue(entity,"speed",0) 
        DispatchKeyValue(entity,"target","entbug") 
        DispatchKeyValue(entity,"targetname","entbug") 
        DispatchKeyValue(entity,"killtarget","entbug") 
        DispatchKeyValue(entity,"delay",1) 
        DispatchKeyValue(entity,"wait",1) 
        DispatchKeyValue(entity,"moveto",1) 
        DispatchSpawn(entity) 
        entity_set_string(entity, EV_SZ_classname, "trigger_camera")
        }

Last edited by Phant; 03-21-2010 at 02:54.
Phant is offline
Send a message via ICQ to Phant
Old 02-26-2010, 00:20
Phant
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 03-21-2010 , 02:57   Re: Add entity in map
Reply With Quote #19

How to add decal from decals.wad on wall?
Need to do it in plugin_precache() (not Wall Text plugin), I have coords (I think if my coords have 90°, 180°, etc. walls — it simple). Thanks...
Phant is offline
Send a message via ICQ to Phant
Phant
Veteran Member
Join Date: Sep 2009
Location: New Jersey
Old 03-25-2010 , 15:09   Re: Add entity in map
Reply With Quote #20

I think this its possible by this command:
EF_StaticDecal ( const Float:ORIGIN[3], decalIndex, entityIndex, modelIndex )
Meybe anybody can give example?
Phant is offline
Send a message via ICQ to Phant
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 14:32.


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