AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Not good with write_short ect. please help (https://forums.alliedmods.net/showthread.php?t=54658)

Styles 04-30-2007 23:12

Not good with write_short ect. please help
 
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?!

VEN 05-01-2007 04:11

Re: Not good with write_short ect. please help
 
It is reset on spawn automatically.

Styles 05-01-2007 04:15

Re: Not good with write_short ect. please help
 
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
}


Zenith77 05-01-2007 11:56

Re: Not good with write_short ect. please help
 
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.

VEN 05-01-2007 14:01

Re: Not good with write_short ect. please help
 
You use invalid fade flags. See http://wiki.amxmodx.org/index.php/Ha...nts#ScreenFade for valid flags.

Styles 05-01-2007 18:18

Re: Not good with write_short ect. please help
 
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

VEN 05-01-2007 18:32

Re: Not good with write_short ect. please help
 
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);

Styles 05-01-2007 18:53

Re: Not good with write_short ect. please help
 
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
}


VEN 05-01-2007 19:05

Re: Not good with write_short ect. please help
 
http://forums.alliedmods.net/showpos...82&postcount=5
http://forums.alliedmods.net/showpos...6&postcount=10

Styles 05-01-2007 19:07

Re: Not good with write_short ect. please help
 
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
}



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

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