AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Model Restriction problem (https://forums.alliedmods.net/showthread.php?t=17251)

DotNetJunkie 08-28-2005 08:25

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!

pdoubleopdawg 08-28-2005 12:37

register_forward(FM_SetModel,"Function",0)

That would probably be the best thing to catch.

DotNetJunkie 08-28-2005 18:43

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!

pdoubleopdawg 08-28-2005 19:08

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.

pdoubleopdawg 08-28-2005 19:55

Actually, on the first function you should add a

if(is_user_connected) {
}

-- It tries to target the server!

DotNetJunkie 08-29-2005 04:59

Ok I see, I'll try this when I get the chance and keep you posted, thanks!

DotNetJunkie 08-29-2005 05:13

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.