PDA

View Full Version : Particles


[WoH]Killemall4u
09-28-2006, 08:17 PM
Is there a way to make a small plugin to force everyone to have cl_particlefx on to play the map the way it was intended for more realism?

diamond-optic
09-28-2006, 08:40 PM
take this and put it in notepad or something.. save it as a file with .sma extension.. compile.. upload.. add to plugins.ini etc etc...

should do the trick.. sets the players cl_particlefx cvar when they connect.. and it should also block them from changing it...

use:
dod_cl_particlefx "2"
to set the level you want to force...

// diamond-optic
// 09-28-06

#include <amxmodx>

new p_particlefx

public plugin_init()
{
register_plugin("Dod Force Particlefx","1.0","diamond-optic")

p_particlefx = register_cvar("dod_cl_particlefx","2")
register_concmd("block", "funcBlock")
}

public client_connect(id)
{
client_cmd(id,"cl_particlefx %d;alias cl_particlefx block", get_pcvar_num(p_particlefx))
}

public funcBlock(id)
{
client_print(id, print_console, "Sorry but cl_particlefx is locked at %d by the server...", get_pcvar_num(p_particlefx))
return PLUGIN_HANDLED
}

[WoH]Killemall4u
09-28-2006, 08:42 PM
Your great thanks alot for the quick response I thank you very much I put it on the server works great only problem is no one can change cl_particlefx back to 0 on other servers this blocks it permanent it says in console unknown command block ! help we are all stuck at cl_particle fx 2 unless you completly exit steam to reset it back to normal I disabled the plugin and still can't change my cl_particle fx back to 0
its still saying unknown command: block where would it save it to I can't open my server to the public until I get this fixed

=|[76AD]|= TatsuSaisei
09-28-2006, 10:03 PM
I thought I remembered how to "unalias" but I was wrong, so I changed my post... sorry to waste space...

just remove the ;alias cl_particlefx block part of the code and then you can change it on a player, but players can still change it back...

I am looking into unaliasing though... I am curious now...

[WoH]Killemall4u
09-28-2006, 10:19 PM
I tried this I still cannot change it back to cl_particle fx 0 Unknown command: block is what I get when I try to switch it back on any server

Thanks for trying to help me

Wilson [29th ID]
09-28-2006, 11:47 PM
They will have to restart day of defeat. As soon as they go in another server they can set it back to normal. Helps to have them set their config as read-only so all they have to do is restart dod.

But yeah there's no way to "re-alias" it.

BUT

if you want to just set it to particlefx 2 and not BLOCK it, that's very easy. just take out the alias part in the command that's sent to the client. If you don't understand let us know and we'll code it.

[WoH]Killemall4u
09-29-2006, 01:51 AM
Yeah if you would not mind fixing it for I am trying to learn by reading but its not easy

Thanks

Wilson [29th ID]
09-29-2006, 02:16 AM
// wilson pwns diamond-optic
// 09-28-06

#include <amxmodx>

new p_particlefx

public plugin_init()
{
register_plugin("Dod Force Particlefx","1.0","diamond-optic")

p_particlefx = register_cvar("dod_cl_particlefx","2")
}

public client_connect(id)
{
if(get_pcvar_num(p_particlefx)>0)
client_cmd(id,"cl_particlefx %d", get_pcvar_num(p_particlefx))
}

Set it to -1 to completely disable the plugin.

orbit
09-29-2006, 04:41 AM
You can also use hlguard to lock cvars as well. When players leave, they don't have to reboot to reset their cvars.

I do this all the time.

-O-

Wilson [29th ID]
09-29-2006, 05:58 AM
Wow, can you ellaborate, orbit? How can I find out more about this?

[WoH]Killemall4u
09-29-2006, 09:30 AM
Thanks everyone for the quick responses I greatly appreciate it

diamond-optic
09-29-2006, 09:53 PM
']Wow, can you ellaborate, orbit? How can I find out more about this?

in hlguard/config/hl/hlg_cvars.cfg

for example.. putting:
hlg_conncommand "voice_inputfromfile 0; alias voice_inputfromfile"
will stop ppl from being able to use HLSS or whatever to play music files over the voice comm..

Wilson [29th ID]
09-30-2006, 02:56 AM
Wow, that's awesome. The only thing is I'd like to do something like this only when a cvar is activated. Sorta like a "toggle." I know theoretically I could toggle HLGuard but do you know how HL guard makes it so that they won't have to restart steam so I can do it?