Raised This Month: $ Target: $400
 0% 

Not good with write_short ect. please help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-30-2007 , 23:12   Not good with write_short ect. please help
Reply With Quote #1

When using:
Code:
public blackscreen(id)
{
	message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
	write_short(~0);
	write_short(~0);
	write_short(1<<12);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	message_end();
	return PLUGIN_HANDLED
}
How can I get the persons screen to return normal on spawn?!
Styles is offline
Send a message via AIM to Styles
VEN
Veteran Member
Join Date: Jan 2005
Old 05-01-2007 , 04:11   Re: Not good with write_short ect. please help
Reply With Quote #2

It is reset on spawn automatically.
VEN is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 05-01-2007 , 04:15   Re: Not good with write_short ect. please help
Reply With Quote #3

o thanks good to know

edit:
why wouldn't this work:
Code:
public plugin_init()
{
	register_plugin("Black Out Mod","1.0","Styles")
	register_event("DeathMsg", "hook_death", "a") 
}
public hook_death()
{
	new id = read_data(2)
	blackscreen(id);
}
public client_putinserver(id)
{
	blackscreen(id)
	return PLUGIN_HANDLED
}

public blackscreen(id)
{
	message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
	write_short(~0);
	write_short(~0);
	write_short(1<<12);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	message_end();
	return PLUGIN_HANDLED
}

Last edited by Styles; 05-01-2007 at 05:04.
Styles is offline
Send a message via AIM to Styles
Zenith77
Veteran Member
Join Date: Aug 2005
Old 05-01-2007 , 11:56   Re: Not good with write_short ect. please help
Reply With Quote #4

Code:
             write_short(~0);     write_short(~0);

I may be wrong (I don't use bitwise operations that much), but '~0' is one. Don't know why you did this.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-01-2007 , 14:01   Re: Not good with write_short ect. please help
Reply With Quote #5

You use invalid fade flags. See http://wiki.amxmodx.org/index.php/Ha...nts#ScreenFade for valid flags.
VEN is offline
Old 05-01-2007, 14:56
Piratearrrr
This message has been deleted by Greentryst. Reason: useless
Old 05-01-2007, 15:29
Zenith77
This message has been deleted by Greentryst. Reason: reply to deleted post
Old 05-01-2007, 16:11
Da_sk8rboy
This message has been deleted by Greentryst. Reason: reply to deleted post
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 05-01-2007 , 18:18   Re: Not good with write_short ect. please help
Reply With Quote #6

lol he should be

- Anyway, I said earlier I wasn't good at this shit lol. I took a look at that and saw memory address but I don't know exactly how and what to do with them.

Thanks
Styles is offline
Send a message via AIM to Styles
VEN
Veteran Member
Join Date: Jan 2005
Old 05-01-2007 , 18:32   Re: Not good with write_short ect. please help
Reply With Quote #7

Paste this into your code
Code:
#define FFADE_IN   0x0000  // Just here so we don't pass 0 into the function
#define FFADE_OUT   0x0001  // Fade out (not in)
#define FFADE_MODULATE  0x0002  // Modulate (don't blend)
#define FFADE_STAYOUT  0x0004  // ignores the duration, stays faded out until new ScreenFade message received
and then you can use this flags.

For example:
write_short(FFADE_STAYOUT);
VEN is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 05-01-2007 , 18:53   Re: Not good with write_short ect. please help
Reply With Quote #8

Hey ven, I got some help from Hawk on aim was wondering would this work?:

Code:
#include <amxmodx>

new g_MsgScreenFade;
public plugin_init()
{
	register_plugin("Black Out Mod","1.0","Styles")
	register_event("DeathMsg", "hook_death", "b") 
	register_event("ResetHUD","EventResetHUD","b");
	g_MsgScreenFade = get_user_msgid("ScreenFade")
}
public hook_death()
{
	new id = read_data(2);
	set_task(1.0, "blackscreen", id, "",0,"b");
}
public client_putinserver(id)
{
	set_task(1.0, "blackscreen", id, "",0,"b");
}

public EventResetHUD(id)
{
	remove_task(id);
}

public blackscreen(id)
{
	message_begin(MSG_ONE_UNRELIABLE,g_MsgScreenFade,_,id);
	write_short(1<<3);
	write_short(1<<4);
	write_short(1<<12);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	message_end();
	return PLUGIN_HANDLED
}
Styles is offline
Send a message via AIM to Styles
VEN
Veteran Member
Join Date: Jan 2005
Old 05-01-2007 , 19:05   Re: Not good with write_short ect. please help
Reply With Quote #9

http://forums.alliedmods.net/showpos...82&postcount=5
http://forums.alliedmods.net/showpos...6&postcount=10
VEN is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 05-01-2007 , 19:07   Re: Not good with write_short ect. please help
Reply With Quote #10

I don't get where and what that means! Grr!!

Code:
public blackscreen(id)
{
	message_begin(MSG_ONE_UNRELIABLE,g_MsgScreenFade,_,id);
	write_short(1<<3);
	write_short(FFADE_STAYOUT);
	write_short(1<<12);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	message_end();
	return PLUGIN_HANDLED
}
Styles is offline
Send a message via AIM to Styles
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 06:40.


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