Why is this not just for the person who triggered it?

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Why is this not just for the person who triggered it?

Post by Rezil » May 9th, 2010, 1:18 pm

Ok so I have this code:

Code: Select all

[snip snip]


		t waittill("trigger", user);
		if (user.have_messhall_key)
		
		{
			wait 0.2;
			user iprintln("You unlock the door.");
			wait 1;
			user freezecontrols(true);
			user setClientCvar("hud_enable", "0");
			
			user.d_shdr = newHudElem();
			user.d_shdr.x = 0;
			user.d_shdr.y = 0;
			user.d_shdr.alignX = "left";		
			user.d_shdr.alignY = "top";
			user.d_shdr.alpha = 1;
			user.d_shdr setshader("black", 5000, 5000);

		}

[snip snip]
Why does the shader show up for ALL the players on the server and not just the one who triggered it?
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Why is this not just for the person who triggered it?

Post by Moustache » May 9th, 2010, 2:04 pm

Shouldn't all "user" parts be "self"?

I don't know I am not good (read freaking noob) @ scripting. But you can give it a try.

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Why is this not just for the person who triggered it?

Post by waywaaaard » May 9th, 2010, 2:40 pm

Did you precache the shader?

precacheShader("black");

But I guess this isn't the problem.
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Why is this not just for the person who triggered it?

Post by Rezil » May 9th, 2010, 2:48 pm

Yeah, still doesn't work, all players get the black shader on their screen, not only 1.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

_DanTheMan_
PC Team
PC Team
Posts: 294
Joined: September 6th, 2008, 2:14 am

Re: Why is this not just for the person who triggered it?

Post by _DanTheMan_ » May 9th, 2010, 3:28 pm

Rez|l wrote:

Code: Select all

			user.d_shdr = newHudElem();
If you have newHudElem, then you make a hud elem for everyone... shouldn't it be:

Code: Select all

			user.d_shdr = newClientHudElem(user);
?
Image

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Why is this not just for the person who triggered it?

Post by waywaaaard » May 9th, 2010, 3:44 pm

yep just wanted to post that too :)

newClientHudElem(ent);

edit: btw if you want to have the shader over the whole screen and no wide screen problems use this

Code: Select all

	 user.d_shdr = newHudElem(user);
	 user.d_shdr.x = 0;
         user.d_shdr.y = 0;
   	 user.d_shdr.horzAlign = "fullscreen";
    	 user.d_shdr.vertAlign = "fullscreen";
         user.d_shdr.alignX = "left";      
         user.d_shdr.alignY = "top";
	 user.sort = -2;
         user.d_shdr.alpha = 1;
         user.d_shdr setshader("black", 640, 480);
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Why is this not just for the person who triggered it?

Post by Drofder2004 » May 9th, 2010, 3:44 pm

_DanTheMan_ wrote:

Code: Select all

user.d_shdr = newClientHudElem(user);
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Why is this not just for the person who triggered it?

Post by Rezil » May 9th, 2010, 6:00 pm

Ahh yeah that's it, I thought by using user.shader it would automatically assign the shader only to the user. Thanks guys!
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests