Raised This Month: $51 Target: $400
 12% 

Block lastinv, invnext, invprev commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-21-2011 , 19:21   Block lastinv, invnext, invprev commands
Reply With Quote #1

Is it possible?
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-21-2011 , 19:27   Re: Block lastinv, invnext, invprev commands
Reply With Quote #2

"lastinv" is hookable, you could try to return PLUGIN_HANDLED and see, I dunno about the others... but like I said, try and see, it would've been faster if you did that in the first place.
__________________
Hunter-Digital is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-21-2011 , 20:03   Re: Block lastinv, invnext, invprev commands
Reply With Quote #3

Yes I did that and I know it isn't hookable, but there has to be a way to do this since it actually changes the client's weapon and that should the server know, right?

I need a solution to block weapon change, as I've created a command table for all weapons, slot1-6 or something and lastinv, invnext, invprev - everything is blocked nicely but those 3 commands just do work.

If there is a better solution to completely block the weapon change (since I can't let the player weapon model to be changed, I guess hooking CurWeapon won't do here), I can use that too.

Thanks in advance
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-21-2011 , 20:07   Re: Block lastinv, invnext, invprev commands
Reply With Quote #4

Ehm...
Quote:
Originally Posted by Hunter-Digital View Post
"lastinv" is hookable, you could try to return PLUGIN_HANDLED and see, I dunno about the others... but like I said, try and see, it would've been faster if you did that in the first place.
I remember it beeing hookable since I used it on a older plugin of mine, but I dunno if it can be blocked since the players that used it only had one weapon.

I dunno about weapon switch blocking, there are serval methods that I can think of... but you should see plugins which have that feature and see how they did it.
__________________

Last edited by Hunter-Digital; 08-21-2011 at 20:09.
Hunter-Digital is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-21-2011 , 20:09   Re: Block lastinv, invnext, invprev commands
Reply With Quote #5

Maybe it is, but you cannot cancel the execution.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-21-2011 , 20:10   Re: Block lastinv, invnext, invprev commands
Reply With Quote #6

Then don't, use engclient_cmd() to switch to the desired weapon :}
__________________
Hunter-Digital is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-22-2011 , 09:01   Re: Block lastinv, invnext, invprev commands
Reply With Quote #7

PHP Code:
public ChangeCommand(id)
    if(
something)
        
engclient_cmd(id"lastinv"
It cannot be used like this, you can't change the weapon, yes - but it changes the weapon model to, for example, knife and then back to deagle, which is incorrect for me. I can't let the model be changed.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-22-2011 , 11:25   Re: Block lastinv, invnext, invprev commands
Reply With Quote #8

Does this have to be permanent ? Because you can simply remove the knife if you don't want players to switch to it...
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-22-2011 , 12:20   Re: Block lastinv, invnext, invprev commands
Reply With Quote #9

Instead of asking this, discribe what you are exactly trying to do in your plugin.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 08-23-2011 , 06:08   Re: Block lastinv, invnext, invprev commands
Reply With Quote #10

I was editing CarMod a little, so I wanted the user to not be able to change weapon model while car view model has been set.

I actually found a little different, not-as-good way to do this - saving the client weapon and model into global variables, change the viewmodel and weaponmodel on CurWeapon model and set his weapon and models back when he quits the car. It's not that good because swapping weapons in the car makes the model change to left-handed and right-handed continuously, but as long as it works, it's great too.

However, thanks for replies Hunter-Digital. Here's a beacon for you.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
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 11:14.


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