AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help Hud (https://forums.alliedmods.net/showthread.php?t=241185)

plazma 05-29-2014 16:27

Help Hud
 
Its any new Hud Messages because my plugin have Reliable overflow to players. what is the problem?

Blizzard_87 05-29-2014 16:48

Re: Help Hud
 
Quote:

Originally Posted by plazma (Post 2144144)
Its any new Hud Messages because my plugin have Reliable overflow to players. what is the problem?

The problem is I.... have no idea.

Maybe posting the code which is causing the problem will help us help you.

Can't give you an answer without seeing any of your code.

plazma 05-30-2014 06:26

Re: Help Hud
 
Something like this :


PHP Code:

#include < amxmodx >
#include < amxmisc >

new g_iMessagesCountg_iVariableg_iAdvertisementsSync;

enum _BLEAHHHRED], GREEN], BLUE], MESSAGE512 ] }

static const 
szMessages[ ][ BLEAHHH ] =
{
    { 
255000000"1 = Hello, it Worked!" },
    { 
000255000"2 = Hello, it Worked!" },
    { 
000000200"3 = Hello, it Worked!" },
    { 
000200000"4 = Hello, it Worked!" },
    { 
200000000"5 = Hello, it Worked!" }
}

public 
plugin_init( )
{
    
register_plugin"Messages Shower""1.0b""[dvL]aditza" );

    
g_iAdvertisementsSync CreateHudSyncObj( );
    
g_iMessagesCount sizeofszMessages ) -1;

    
set_task5.0"Task_HudMessages", .flags"b" );
}

public 
Task_HudMessages( )
{
    if( 
g_iVariable g_iMessagesCount )
        
g_iVariable 0;
    
    
set_hudmessageszMessagesg_iVariable ][ RED  ], szMessagesg_iVariable ][ GREEN ], szMessagesg_iVariable ][ BLUE ], -1.00.2000.512.02.02.0, -);
    
ShowSyncHudMsg0g_iAdvertisementsSync"%s"szMessagesg_iVariable ][ MESSAGE] );

    
g_iVariable++;



aron9forever 05-30-2014 06:41

Re: Help Hud
 
at least set a .2 second delay between them holy shit
sending this to 32 players might even crash the server

.Dare Devil. 05-30-2014 07:25

Re: Help Hud
 
Reliable overflow comes because you are sending huge data too fast to player.
By huge data i meant the size of hudmessage text.

Quote:

Originally Posted by aron9forever (Post 2144356)
at least set a .2 second delay between them holy shit
sending this to 32 players might even crash the server

no way...

plazma 05-30-2014 07:35

Re: Help Hud
 
.Dare Devil. Have any idea for this code ?

aron9forever 05-30-2014 11:44

Re: Help Hud
 
Quote:

Originally Posted by .Dare Devil. (Post 2144375)
Reliable overflow comes because you are sending huge data too fast to player.
By huge data i meant the size of hudmessage text.


no way...

messages like these are sent over the reliable channel
if an important message fails to get sent to the client because all the bandwidth is taken by these hud messages for example, the server will crash with the error FSB_ALLOWOVERFLOW set on Server Reliable Datagram

Nextra 05-30-2014 12:59

Re: Help Hud
 
Quote:

Originally Posted by plazma (Post 2144351)
Something like this :

"Something like this" is not good enough. Sending one hudmessage every five seconds will never overflow the reliable channel and never cause a crash. Either post your plugin or recreate a complete compilable plugin that exhibits the crash. Showing us how to use hudmessages won't help, we know that.

On a side note: sizeof is a compile-time construct and not a runtime function. Saving the result of sizeof into a runtime variable is completely pointless and will not improve performance (quite the contrary actually).


All times are GMT -4. The time now is 09:39.

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