AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   server spray decal (https://forums.alliedmods.net/showthread.php?t=8481)

Cheap_Suit 12-13-2004 17:05

server spray decal
 
anyknow how to set all users sprays to what ever spray decal in the server.

like if I only want them to spray my logo.. :oops:

IMBA 12-14-2009 12:33

Re: server spray decal
 
I NEED THIS !

joropito 12-14-2009 12:52

Re: server spray decal
 
You may block player decal and put your own using SVC_TEMPENTITY

PHP Code:

#define TE_WORLDDECAL               116      // Decal applied to the world brush
// write_byte(TE_WORLDDECAL)
// write_coord(position.x) decal position (center of texture in world)
// write_coord(position.y)
// write_coord(position.z)
// write_byte(texture index of precached decal texture name) 

I don't know if I'm right with that.
Maybe you can change what players see but not the local player sprite.

ConnorMcLeod 12-14-2009 13:57

Re: server spray decal
 
Try this :

PHP Code:

#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"

#define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)

new g_iUniqueDecal

public plugin_init()
{
    
register_plugin("All Player Same Tag"VERSION"ConnorMcLeod")

    
g_iUniqueDecal engfuncEngFunc_DecalIndex "{siteB" )

    
register_message(SVC_TEMPENTITY"Message_TempEntity")
}

public 
Message_TempEntity()
{
    if( 
get_msg_arg_int(1) == TE_PLAYERDECAL )
    {
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_WORLDDECAL)
        
write_coord_f(get_msg_arg_float(2))
        
write_coord_f(get_msg_arg_float(3))
        
write_coord_f(get_msg_arg_float(4))
        
write_byte(g_iUniqueDecal)
        
message_end()
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE



-edit-
WTF engfunc( EngFunc_DecalIndex , "{siteB" ) returns always 0

I was using this in a private gore plugin and was working fine (hadn't rested it)
PHP Code:

GetBloodDecals()
{
    new 
szDecalName[11], i
    
while( sizeofg_iBloodDecals ) )
    {
        
formatex(szDecalNamecharsmaxszDecalName ), "{blood%d"1)
        
g_iBloodDecalsi++ ] = engfuncEngFunc_DecalIndex szDecalName )
    }
    
0
    
while( sizeofg_iBigBloodDecals ) )
    {
        
formatex(szDecalNamecharsmaxszDecalName ), "{bigblood%d"1)
        
g_iBigBloodDecalsi++ ] = engfuncEngFunc_DecalIndex szDecalName )
    }



Toastt 12-14-2009 21:09

Re: server spray decal
 
whats the command to set the time for the spray to reload
like someone sprayed, and now they have to wait a certain ammount of time to spray again o.O

ConnorMcLeod 12-15-2009 05:48

Re: server spray decal
 
Global cvar is decalfrequency.
This cvar is used to set players offset m_flNextDecalTime (486) based on gametime when they spawn or when they kill a player.

Also, offset m_nCustomSprayFrames (485) seems to be -1 when tags are not allowed (the lambda hl logo for everyone) and 1 when it's a custom tag, HLSDK says that it can take values from 1 to 8 but it seems that sprays with more than 1 frame are not implemented.


All times are GMT -4. The time now is 01:27.

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