[TF2] Set Player's Weapon & Force Fire
I'm making a plugin that allows me to control bots. Right now I'm trying to figure out how to force a bot to change to a specific weapon. I'm also trying to figure out how to force him to shoot. I've been searching through the wiki, forums, existing plugins, and other sites and I can't find anything that would work (for TF2 at least). Any suggestions would be greatly appreciated!
|
Re: [TF2] Set Player's Weapon & Force Fire
bot_forceattack 1
bot_selectweaponslot <0-2> use to work before the Engi Update, I don't think it does anymore though. |
Re: [TF2] Set Player's Weapon & Force Fire
Thanks for the idea, but this isn't what I was looking for. I want to control bots individually and bot_forceattack forces all the bots to shoot. Also, these commands require sv_cheats 1 and I'd like cheats to be off so plays can receive achievements. Is there a way to do this at the plugin level such as FireEvent()?
|
Re: [TF2] Set Player's Weapon & Force Fire
Quote:
|
Re: [TF2] Set Player's Weapon & Force Fire
Wow... these forums are extremely useless... Or at the very least the last two posts are useless. I'm not trying to get my own achievements. If that was my goal, I wouldn't be posting in a forum that is for people developing SM plugins for servers... I'm trying to make my own achievement server and I plan on having features that I haven't found in any other server (or in some cases only 1 or 2 servers, but still). If I wanted help playing TF2 I'd post in the Steam forums. If I wanted to understand server commands I'd Google it. I'm trying to get help with sm plugin functions. Now that I've (hopefully) made that clear, can anyone help me achieve what I'm ACTUALLY trying to do?
|
Re: [TF2] Set Player's Weapon & Force Fire
you can try to create your own NPC and control him like that
|
Re: [TF2] Set Player's Weapon & Force Fire
Let me clarify my last statement. I no way to I want to insult anyone who help me. I'm simply getting angry because I don't think I've really received any actual help yet. I just want to make some quality plugins and I ask for help with the code any everyone starts giving me ideas that have anything to do with writing code. That's where I'm coming from.
|
Re: [TF2] Set Player's Weapon & Force Fire
I understand your frustration flintb.
Now hopefully I can help you out. Look in sdktools_functions.inc and find EquipPlayerWeapon(client, weapon); I think that should help you force a bot to use a weapon. You can combine that with SDKHooks' WeaponEquip hook to prevent them from switching away to the weapon you want them to use. As for forcing them to attack you can try this, but I don't know if it works: Code:
new flags = GetEntityFlags(client); |
Re: [TF2] Set Player's Weapon & Force Fire
Thank you for the help! That's what I was looking for. I looked into EquipPlayerWeapon some but I only found how to equip CSS weapons. Do you know where I might be able to find a TF2 weapon index list? I haven't found one yet. I guess I can also do trial and error if worst comes to worst (although that might take a while). Also, the weapon flag description says "CBaseCombatWeapon entity index.". What exectly does "CBase" in "CBaseCombatWeapon" mean (if anything)?
|
Re: [TF2] Set Player's Weapon & Force Fire
Code:
GetPlayerWeaponSlot(client, slot); Also, by your wording it seems you think that each weapon as an assigned index. Each weapon in game has a unique entity index. So there can be 10 eyelanders in use in the game, each with their own index. The function above will return that index for you. "CBase" means it exists for all source games. It's a classname in the engine's source code. There are game-specific classes as well such as CCS and CTF, which is CS:S and TF2 specific, respectively. |
All times are GMT -4. The time now is 13:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.