AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help new round (https://forums.alliedmods.net/showthread.php?t=51201)

SAMURAI16 02-13-2007 10:42

help new round
 
i have this public:
Code:

public streamfunc(index)
{
    new g_r = random(256)
    new g_b = random(256)
    new g_g = random(256)
   
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY)   
   
    write_byte(22)
   
    write_short(index)   
   
    write_short( spr )
   
    write_byte(200)
    write_byte(8)
   
    write_byte(g_r)
    write_byte(g_b)
    write_byte(g_g)
   
    write_byte(100)   
   
    message_end()
}

And also i have an "ResetHUD" event. I want to disable that stream on reset hud . How i can do that ?
I tryed with this:
Code:

public stopstr(index)
{
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY)   
   
    write_byte(22)
   
    write_short(index)   
   
    write_short( 0 )
   
    write_byte(200)
    write_byte(8)
   
    write_byte(0)
    write_byte(0)
    write_byte(0)
   
    write_byte(100)   
   
    message_end()
}

But doesent works .

Hope you are understand, thanks

gzus 02-13-2007 10:56

Re: help new round
 
are u trying to have this msg be displayed every new round? im not the best coder, but the only was i can get stuff to display every round is with the hook hud option.

PHP Code:

public plugin_init()

register_plugin(PLUGINVERSIONAUTHOR
register_event("ResetHUD""hook_hud""b")
 } 
//------------------------------------------------------------------------------------------- 
public hook_hud(id)

server_print("-- DEBUGGED BY CODE -- [hooking hud]",0.01
//maybe this is where u call your stopstr ?? 
stopstr(index
return 
PLUGIN_HANDLED
 


im not possative, but this seems like it should work.

SSJ2GOKU 02-13-2007 10:59

Re: help new round
 
in message_const.inc (location: amxmodx/scripting/include/) you can find a function to destroy the followbeam

#define TE_KILLBEAM 99 // Kill all beams attached to entity
// write_byte(TE_KILLBEAM)
// write_short(entity)

so in code it should be:

Code:

public stopstr(index){
    message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    write_byte(99)
    write_short(index)
    message_end()
}


gzus 02-13-2007 11:01

Re: help new round
 
oh never mind then i misread you, i honestly have no clue how to kill the beams like that, never used them, sorry

SAMURAI16 02-13-2007 11:24

Re: help new round
 
thanks SSJ2GOKU it's works


All times are GMT -4. The time now is 00:43.

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