How to Block cz bot from putting silencer on?
Hello,
I am trying to get cz bots to never use a silencer on the USP and possibly sometimes use silencer on m4 and sometimes use burst on glock and famas. Disabling USP silencer on bots is the most importance issue however. I used ConnorMcLeod's ham_register_cz_bots in thinking that the following script would work for bots, but it doesn't. It only works for humans. If it were possible to only block usp silencer on bots that would be even better. Here is the script: #include <amxmodx> #include <cstrike> #include <fakemeta> #include <hamsandwich> const m_flNextSecondaryAttack = 47 public plugin_init() { register_plugin( "Block USP Secondary Attack", "1.0", "Amxx Community" ) RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_usp" , "Event_BlockSecondaryAttack" , 1 ) RegisterHam( Ham_Item_Deploy , "weapon_usp" , "Event_BlockSecondaryAttack", 1 ) } public Event_BlockSecondaryAttack ( const Entity ) { set_pdata_float( Entity , m_flNextSecondaryAttack , 9999.0, 4 ) } public cz_bot_ham_registerable( id ) { } Thanks so much for any assistance. |
Re: How to Block cz bot from putting silencer on?
Please use php tags to post code (or pawn), it will be kept indented and be more readable.
You don't need the cs_bot_ forward because what you use is called from usp and not bot. Register the Secondary Attack forward as pre and not post, let the Deploy one post. In the forwards callback, retrieve player index using get_pdata_cbase + m_pPlayer offset, check if this player is a bot, then set m_flNextSecondaryAttack. |
Re: How to Block cz bot from putting silencer on?
I apologize for my ignorance. I am a beginner at this and not quite sure how to put into the script what you are telling me to.
|
Re: How to Block cz bot from putting silencer on?
PHP Code:
|
Re: How to Block cz bot from putting silencer on?
Sorry. I meant I didn't know how to do the following to get the script to work:
Register the Secondary Attack forward as pre and not post, let the Deploy one post. In the forwards callback, retrieve player index using get_pdata_cbase + m_pPlayer offset, check if this player is a bot, then set m_flNextSecondaryAttack. Thanks. |
Re: How to Block cz bot from putting silencer on?
Try this :
Code involved : https://github.com/Arkshine/CSSDK/bl...ls/wpn_usp.cpp PHP Code:
|
Re: How to Block cz bot from putting silencer on?
This works great. You are amazing! I tried using this code to force the bots to set the famas to burst, but it freezes. Any ideas?
PHP Code:
|
Re: How to Block cz bot from putting silencer on?
Also, Not sure if this is possible, but maybe there is a way to force bots to switch to burst when they are a certain distance from the enemy. long distance burst for famas/short distance no burst and short distance burst for glock/long distance no burst?
|
Re: How to Block cz bot from putting silencer on?
hey.. my name is tabitha.. i've been bored lately looking for advice and i didn't realize that the classic chats and forums still existed! i spend a lot of time now on aim chat rooms rambling on about php python n other random stuff :p
|
| All times are GMT -4. The time now is 11:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.