Raised This Month: $ Target: $400
 0% 

Model Restriction problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DotNetJunkie
Senior Member
Join Date: May 2005
Location: In front of my pc
Old 08-28-2005 , 08:25   Model Restriction problem
Reply With Quote #1

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!
__________________
DotNetJunkie is offline
Send a message via ICQ to DotNetJunkie Send a message via AIM to DotNetJunkie Send a message via MSN to DotNetJunkie Send a message via Yahoo to DotNetJunkie
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-28-2005 , 12:37  
Reply With Quote #2

register_forward(FM_SetModel,"Function",0)

That would probably be the best thing to catch.
pdoubleopdawg is offline
DotNetJunkie
Senior Member
Join Date: May 2005
Location: In front of my pc
Old 08-28-2005 , 18:43  
Reply With Quote #3

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!
__________________
DotNetJunkie is offline
Send a message via ICQ to DotNetJunkie Send a message via AIM to DotNetJunkie Send a message via MSN to DotNetJunkie Send a message via Yahoo to DotNetJunkie
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-28-2005 , 19:08  
Reply With Quote #4

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.
Attached Files
File Type: sma Get Plugin or Get Source (code.sma - 501 views - 1.2 KB)
pdoubleopdawg is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-28-2005 , 19:55  
Reply With Quote #5

Actually, on the first function you should add a

if(is_user_connected) {
}

-- It tries to target the server!
pdoubleopdawg is offline
DotNetJunkie
Senior Member
Join Date: May 2005
Location: In front of my pc
Old 08-29-2005 , 04:59  
Reply With Quote #6

Ok I see, I'll try this when I get the chance and keep you posted, thanks!
__________________
DotNetJunkie is offline
Send a message via ICQ to DotNetJunkie Send a message via AIM to DotNetJunkie Send a message via MSN to DotNetJunkie Send a message via Yahoo to DotNetJunkie
DotNetJunkie
Senior Member
Join Date: May 2005
Location: In front of my pc
Old 08-29-2005 , 05:13  
Reply With Quote #7

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?
__________________
DotNetJunkie is offline
Send a message via ICQ to DotNetJunkie Send a message via AIM to DotNetJunkie Send a message via MSN to DotNetJunkie Send a message via Yahoo to DotNetJunkie
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:31.


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