Raised This Month: $ Target: $400
 0% 

[HELP] Making unbreakable windows and double doors opens bad side.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-27-2013 , 17:25   [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #1

Hello I have 2 problems.

First is about glass, so I want to make glass unbreakable and it's what I'm trying to do:
Code:
public OnMapStart() {

	new langai = -1;
		
	while ((langai = FindEntityByClassname(langai, "func_breakable_surf")) != -1)
	{
		new hammer = Entity_GetHammerId(langai);
	
		if(hammer == 210840 || hammer == 21070 || hammer == 21032 || hammer == 21048)
		{
			AcceptEntityInput(langai, "DisableDamageForces");
		}
	}

}
But it's not working for me.. Windows are still breakable


Now about second problem.It's double doors but they won't open in same direction.To make it clear here are some screenshots:

When server plugin opens both doors:
http://imageshack.com/a/img855/7016/9vgw.jpg

When player opens both doors:

http://img69.**************/img69/9266/3pz5.jpg

Code what I'm trying to use, I tried many codes (with 1 while, with 2 whiles, and now even with 3....)

Code:
	new porte = -1;
	new HAMMERID;
	
	while ((porte = FindEntityByClassname(porte, "prop_door_rotating")) != -1)
	{
		HAMMERID = Entity_GetHammerId(porte);
	
		if(HAMMERID == 616765 || HAMMERID == 616770)
		{
			AcceptEntityInput(porte, "Unlock");
			
		}
	}

	while ((porte = FindEntityByClassname(porte, "prop_door_rotating")) != -1)
	{
		HAMMERID = Entity_GetHammerId(porte);
		// || HAMMERID == 
		if(HAMMERID == 616770  ) {
			AcceptEntityInput(porte, "Open");
		}
	}
	
	while ((porte = FindEntityByClassname(porte, "prop_door_rotating")) != -1)
	{
		HAMMERID = Entity_GetHammerId(porte);
		// || HAMMERID == 
		if(HAMMERID == 616765  ) {
			AcceptEntityInput(porte, "Open");
		}
	}

Last edited by iGANGNAM; 12-27-2013 at 17:51.
iGANGNAM is offline
LeGone
Senior Member
Join Date: Dec 2006
Location: Germany
Old 12-29-2013 , 14:09   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #2

To the first one:
I was wondering the same a few months ago. But was unable to make glass unbreakable.
Donīt think itīs possible to change it. Maybe itīs clientside only

To the second one:
Just an idea. If you just open the door there is no activator-position. If there is no, the door will open in some default-direction.
There might be some vector to set the direction. Or the client-entity itself.
Does it work if you somehow use the AcceptEntityInput with the client-index?
__________________
Want to control Entities? Spawn NPCs? Create Portals?
EntControl
LeGone is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-29-2013 , 18:03   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #3

Quote:
Originally Posted by LeGone View Post
To the second one:
Just an idea. If you just open the door there is no activator-position. If there is no, the door will open in some default-direction.
There might be some vector to set the direction. Or the client-entity itself.
Does it work if you somehow use the AcceptEntityInput with the client-index?
Can you give me example?
iGANGNAM is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-30-2013 , 09:29   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #4

Hmm, here are a few things to maybe try...

For the glass, when it spawns (use SDKHooks to catch this), try dispatching a keyvalue to set its flags to 1... which is the CBreakable flag for "Only break on trigger".

For the doors, when it spawns, try dispatching the Spawn Position keyvalue to either 1 (open forward) or 2 (open back) instead of calling Open on it.

I don't know the exact names of these KeyValues as I don't have a CS:S datamaps dump.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-30-2013 , 10:22   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #5

I have tried
Code:
	new langai = -1;
		
	while ((langai = FindEntityByClassname(langai, "func_breakable_surf")) != -1)
	{
		new hammer = Entity_GetHammerId(langai);
	
		if(hammer == 210840 || hammer == 21070 || hammer == 21032 || hammer == 21048)
		{
			DispatchKeyValue(langai, "CBreakable", "1");
		}
	}
tried spawnflags, windows are are still breakable.

These windows still are breakable.

About doors well that plugin closes and opens doors every 16~ mins.

Last edited by iGANGNAM; 12-30-2013 at 10:32.
iGANGNAM is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-30-2013 , 10:44   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #6

Quote:
Originally Posted by iGANGNAM View Post
About doors well that plugin closes and opens doors every 16~ mins.
Well, if you know the targetname of an item somewhere on the map, you can use the other open OpenAwayFrom input instead... which is presumably what the game uses when a player uses the door with the "!activator" target.

Code:
    new porte = -1;
    new HAMMERID;
    
    while ((porte = FindEntityByClassname(porte, "prop_door_rotating")) != -1)
    {
        HAMMERID = Entity_GetHammerId(porte);
    
        if(HAMMERID == 616765 || HAMMERID == 616770)
        {
            AcceptEntityInput(porte, "Unlock");
            SetVariantString("targetnamehere");
            AcceptEntityInput(porte, "OpenAwayFrom");
        }
    }
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-30-2013 at 10:46.
Powerlord is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 12-30-2013 , 11:19   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #7

Still opens to different sides....Both doors have only same name but not targetname.

------
Target Name:
Name: storederp
Hammer id: 616765
Spawn flags: 8192
------
Target Name:
Name: storederp
Hammer id: 616770
Spawn flags: 8192

Last edited by iGANGNAM; 12-30-2013 at 11:22.
iGANGNAM is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-30-2013 , 11:37   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #8

Quote:
Originally Posted by iGANGNAM View Post
Still opens to different sides....Both doors have only same name but not targetname.

------
Target Name:
Name: storederp
Hammer id: 616765
Spawn flags: 8192
------
Target Name:
Name: storederp
Hammer id: 616770
Spawn flags: 8192
You'll need to use the targetname of something else on the map. If this were TF2, I'd suggest using the team_control_point_master's targetname, but it isn't...
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-15-2014 , 14:30   Re: [HELP] Making unbreakable windows and double doors opens bad side.
Reply With Quote #9

I once tried to break glass manually, but i couldn't do this.
Setting SetEntProp(glassent, Prop_Send, "m_bIsBroken", 1) will make window disappear and just not allow players to break it.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ 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 14:43.


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