Model Restriction problem
I wrote a model restriction plugin that hooks
client_connect, client_putinserver, client_infochanged, and client_disconnect to ensure the player isn't using a restricted model and all that good stuff but I noticed that if someone binds a key to a model (e.g. bind "o" "model laurence") they can change their model. Is there a way to prevent this without a task that checks every second?? Thanks! |
register_forward(FM_SetModel,"Function",0)
That would probably be the best thing to catch. |
Where can I find an example on how to use this to prevent it from
being used or how to change the model when this is called? Thanks! |
1 Attachment(s)
You can use this, release it, whatever. You can also code your own. Cooked this up in about 5 minutes.
amx_addresmodel models/bla.mdl replace models/bla.mdl with the model you want restricted. It writes to file addons/amxmodx/configs/restrictedmodels.ini (You can also do it manually) It disconnects the player then prints in his console that it's restricted. I believe you can use the fakemeta module to supercede him changing his model or something. I havn't tested it, so best of luck. (Needs Engine, and fakemeta to run properly.. If it was CS-only i wouldn't need engine, just cstrike, but it's multi-mod) If you use it, and it doesn't work, just tell me man. |
Actually, on the first function you should add a
if(is_user_connected) { } -- It tries to target the server! |
Ok I see, I'll try this when I get the chance and keep you posted, thanks!
|
Wait, you have it so that it disconnects the player, wonder if I want to
block it altogether without disconnecting the player? Also is it possible for me to change the model without having this function called or client_infochanged? |
| All times are GMT -4. The time now is 14:31. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.