Automatic func_tanks in Counter Strike
1 Attachment(s)
Hello. I was searching for random functions to test with orpheu and got curious about func_tanks. They have auto aiming and shooting functionality but it doesn't work out of the box in CS so I tried to unlock it. The process is easy: we just have to make them think, have basic flags, and override its search for players because it's code inherited from halflife searches for players in PVS but it seems that they don't have one in CS :P.
The code: Code:
public plugin_precache() If you want to use this code in a zombie server or something like that just change the function OnFindClientInPVS and use on it an algorithm of yours to find a player to shoot at (like the closer zombie or whatever). Final notes: It almost could be made without orpheu because fakemeta also provides hooking for FindClientInPVS but I tested it and it didn't get called. Offsets for CFuncTank - http://wiki.amxmodx.org/CFuncTank_%28CS%29 FindClientInPVS can be also called in more situations for other entities (though is unusual) so you might want to add it's hook an extra check to see if it is a func_tank using it. Thanks to Capostrike for testing with me :D Example map: http://www.fpsbanana.com/maps/1080 |
Re: Automatic func_tanks in Counter Strike
Demonstration video: ...
http://www.xfire.com/video/29f364/ please see 2:25 minutes here useful example: PHP Code:
|
Re: Automatic func_tanks in Counter Strike
Good stuff, gonna test it.
|
Re: Automatic func_tanks in Counter Strike
set_pdata_float(id,41,360.0,4) // For full rotation (360º)
|
Re: Automatic func_tanks in Counter Strike
Caostrike, you example they will only shoot people with the last index in the Radio.
You understand me? |
Re: Automatic func_tanks in Counter Strike
It works using fakemeNta too
(I'm using random 1-32 because I'm too lazy to make it better :P) PHP Code:
|
Re: Automatic func_tanks in Counter Strike
But have you tested? When I tested, FM_FindClientInPVS didn't get called.
|
Re: Automatic func_tanks in Counter Strike
Yes, I have tested.
Maybe you miss using forward_return or you use findentityinpvs instead of clientinpvs, I don't know but it's working. |
Re: Automatic func_tanks in Counter Strike
Quote:
|
Re: Automatic func_tanks in Counter Strike
Here's the key name/values used for func_tank
(cs_rats2_final example values) Code:
model *174 |
Re: Automatic func_tanks in Counter Strike
Quote:
by default only attack to team terrorist #define KILL_ONLYT |
Re: Automatic func_tanks in Counter Strike
Quote:
I mean a. player is alive? check team? other? and I almost forgot.. add set_pdata_float(id,41,360.0,4) // For full rotation (360º) :P |
Re: Automatic func_tanks in Counter Strike
Quote:
Quote:
Btw, I think it's possible to set full rotation using key "yawrange". |
Re: Automatic func_tanks in Counter Strike
If you want to use the keyvalue, I guess you need to hook the spawn as pre.
Like Quim said, you can get a list of offsets there http://wiki.amxmodx.org/CFuncTank_(CS) ; and you can see the name is enough explicit to understand the keyvalue name related : Code:
void CFuncTank :: KeyValue( KeyValueData *pkvd ) |
Re: Automatic func_tanks in Counter Strike
This is awesome, good work. It's amazing how the CS modding capabilities are still growing after all these years.
|
Re: Automatic func_tanks in Counter Strike
Quote:
... m_yawRange is num 41 set_pdata_float(id,41,360.0,4) :wink: http://wiki.amxmodx.org/CFuncTank_%28CS%29 |
Re: Automatic func_tanks in Counter Strike
It's more safe to deal with keyvalues than offset since this one can change on update. So if you can, use keyvalues.
Also, if I'm right ( but I've seen some tutorials saying the same thing ), to have a full rotation you should write 180, 180 left + 180 right = 360. Like the Joropito's example : "yawrange 55" ; meaning the range is : 55 + 55 = 110. |
Re: Automatic func_tanks in Counter Strike
Quote:
This should work (not tested). PHP Code:
|
Re: Automatic func_tanks in Counter Strike
I have read somewhere after using DispatchKeyValue you must use DispatchSpawn but looking the HLSDK I don't find any reference to that, so I guess it should work right away. I'm going to try to see.
|
Re: Automatic func_tanks in Counter Strike
Quote:
|
Re: Automatic func_tanks in Counter Strike
You're right, I've tested with this following plugin, type "tank" to spawn an entity in front of you, by default the yaw range is 110°, and if you type "range" it will update the range to 360° and it's well updated right away without needed to spawn again.
PHP Code:
|
Re: Automatic func_tanks in Counter Strike
Nice plugin Arkshine!:)
Is it possible to make it be "unfriendly" to specific players? |
Re: Automatic func_tanks in Counter Strike
This plugin was just a test, it should not be used like that, but for what you ask, you have to do like in #2, looping through all players and adding your filters instead of using directly find_ent_by_class().
|
Re: Automatic func_tanks in Counter Strike
Okay,will do that.Thanks for your answer!
|
Re: Automatic func_tanks in Counter Strike
Quote:
when the player dead, tank still target that player |
Re: Automatic func_tanks in Counter Strike
See the second post. You have to filter. It was just an example.
|
All times are GMT -4. The time now is 13:55. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.