Force Weapon Switch: alternate way?
Is there any other way to force a player to use a specific weapon, besides:
Code:
Already tried Ham_ItemDeploy but it's probably not meant for that, and it doesn't switch weapons properly. |
Re: Force Weapon Switch: alternate way?
Maybe should you use Ham_ItemHolster before.
Btw, why engclient_cmd and not client_cmd ? |
Re: Force Weapon Switch: alternate way?
Quote:
Quote:
client_cmd needs a message to be sent to the player, then the player would send a message back to the server with the command to switch the weapon (not instantly, especially if he has a high latency) |
Re: Force Weapon Switch: alternate way?
I tried to set m_pActiveItem (373) before :
Code:
|
Re: Force Weapon Switch: alternate way?
Oh, and for those wondering what problems I had with the engclient_cmd code, test the following script with amx_forceknife set to 1 and 2. Then set your client-side cl_lw cvar to 0 and test again.
Method #1 makes the server crash with "New message started when msg 35 has not been sent yet". Method #2 results in an additional CurWeapon Event call, but no matching CurWeapon Message pair for it (weird, huh?). Code:
|
Re: Force Weapon Switch: alternate way?
Quote:
Hold on, this one is also crashing the server when setting cl_lw to 0. Damn it. |
Re: Force Weapon Switch: alternate way?
It doesn't matter here Dores, it was just test scripts.
|
Re: Force Weapon Switch: alternate way?
seems that when cl_lw 0 it will fire another message SVC_WEAPONANIM
so method 1 will get that error because it's still in hooking msg curweapon for method 2, I tryied this to remove it Code:
server_print("[TEST] Forcing weapon change...") |
Re: Force Weapon Switch: alternate way?
Quote:
I still don't know what's up with method #2, take a look at this console dump: Code:
] amx_forceknife 2Quote:
For Method #1 I'm now getting kicked out with SVC_BAD when I switch weapons... For method #2 it's still triggering an additional CurWeapon event out of nowhere. |
Re: Force Weapon Switch: alternate way?
Register your event with arg 1 = 1 ( "1=1 ), means the weapon is active.
|
| All times are GMT -4. The time now is 01:38. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.