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

@user@ Userid Issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
moxie2020
Veteran Member
Join Date: Aug 2011
Old 03-31-2013 , 21:13   @user@ Userid Issue
Reply With Quote #1

I have an idle server and I use a plugin to allow my players to be able to use loyalty points to increase their fire rate.

It when they cash in points I user sm_rof @user@ 2 to change their rates. Everything works perfect until I add a puppet bot. (I use puppet bots because they don't fight back). Once there is a bot on the server the attribute gets applied to a bot instead of the player who called the command. It appears to have something to do with users who have a space in their name.

Does anyone know a way around this or a way to make normal bots to sit still?

Thanks in advance.
moxie2020 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 03-31-2013 , 21:27   Re: @user@ Userid Issue
Reply With Quote #2

If you are using GetClientUserId on the client, i assume you are using servercommand, which isn't great but whatever, you should be able to do like

Servercommand("Sm_rof #%d 10",GetClientUserId(client))

It should never target fake clients anyways because the user id is the client's user id and that won't change until they disconnect. You can check if a client is a player with IsFakeClient, but you should not have to as bots would generally not be targeted, but just in case like if you give points for time or something, skip over them in your loops.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 03-31-2013 at 21:37.
friagram is offline
moxie2020
Veteran Member
Join Date: Aug 2011
Old 04-01-2013 , 00:06   Re: @user@ Userid Issue
Reply With Quote #3

Quote:
Originally Posted by friagram View Post
If you are using GetClientUserId on the client, i assume you are using servercommand, which isn't great but whatever, you should be able to do like

Servercommand("Sm_rof #%d 10",GetClientUserId(client))

It should never target fake clients anyways because the user id is the client's user id and that won't change until they disconnect. You can check if a client is a player with IsFakeClient, but you should not have to as bots would generally not be targeted, but just in case like if you give points for time or something, skip over them in your loops.
That is the code I am using. I think since puppet bots are meant to mimic other players that is the issue somehow. It always sends the command to the first puppet bot added.

I see you made the freeze tag mod. Is there any way to "freeze" the normal TF2 bots? That would be ideal. The only reason I use the puppet bots in the first place is the normal bots try to fight or at a minimum turn with the players. When they are used this never happens.
moxie2020 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-01-2013 , 00:24   Re: @user@ Userid Issue
Reply With Quote #4

Do if isfakeclient

SetEntityMoveType(entity, MOVETYPE_NONE)

This will stop them from moving when you do it to them and freeze them in place, but it may make it look like they are swimming.

There is a convar you can set to make all bots spawn as one class, why not just make them all medics... There is another you can set to make them only use melee weapons.

http://wiki.teamfortress.com/wiki/Bots

If set to a class name, all TFBots will respawn as that class.
Syntax
tf_bot_force_class <class>
Parameters
<class>
The classname of the class can be Demoman, Engineer, HeavyWeapons, Medic, Pyro, Scout, Soldier, Sniper, or Spy. Default is "" (aka blank).
Example
tf_bot_force_class medic will make all TFbots respawn as Medic.


Determines whether a bot should only use Melee weapons or not.
Syntax
tf_bot_melee_only <integer>
Parameters
<integer>
Either 1 or 0. Default is 0 (disabled).



You may want to remove some or all of their weapons, but they will go ref if you remove all. Not sure what they will do if you use the melee only cvar and leave them without a melee weapon, they may just sand there.

TF2_RemoveWeaponSlot(client, SLOT)
http://docs.sourcemod.net/api/index....d=show&id=857&
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 04-01-2013 at 00:28.
friagram is offline
moxie2020
Veteran Member
Join Date: Aug 2011
Old 04-01-2013 , 00:53   Re: @user@ Userid Issue
Reply With Quote #5

Quote:
Originally Posted by friagram View Post
Do if isfakeclient

SetEntityMoveType(entity, MOVETYPE_NONE)

This will stop them from moving when you do it to them and freeze them in place, but it may make it look like they are swimming.

There is a convar you can set to make all bots spawn as one class, why not just make them all medics... There is another you can set to make them only use melee weapons.

http://wiki.teamfortress.com/wiki/Bots

If set to a class name, all TFBots will respawn as that class.
Syntax
tf_bot_force_class <class>
Parameters
<class>
The classname of the class can be Demoman, Engineer, HeavyWeapons, Medic, Pyro, Scout, Soldier, Sniper, or Spy. Default is "" (aka blank).
Example
tf_bot_force_class medic will make all TFbots respawn as Medic.


Determines whether a bot should only use Melee weapons or not.
Syntax
tf_bot_melee_only <integer>
Parameters
<integer>
Either 1 or 0. Default is 0 (disabled).



You may want to remove some or all of their weapons, but they will go ref if you remove all. Not sure what they will do if you use the melee only cvar and leave them without a melee weapon, they may just sand there.

TF2_RemoveWeaponSlot(client, SLOT)
http://docs.sourcemod.net/api/index....d=show&id=857&
The freeze entity is what I needed. Will they stay frozen on respawn or do I need to hook the spawn event?

I want them to not move at all so they line up for all classes. Especially the spies for backstabs. Basically its just for racking up achievements.
moxie2020 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-01-2013 , 01:11   Re: @user@ Userid Issue
Reply With Quote #6

You have to do it every spawn. The bots can still pivot though, they just cant move in any direction. Like i said, try making them some specific class or taking away their weapon slots or forcing melee mode to break their ai if they do try to fight.

There was a cvar that used to blind bots, but i dont know if imt still works, it was something like nb_blind, but im just guessing at it and no idea if it works in tf.

Why not just make it remove the bots weapons, and when they die, respawn them where they die in the same place, with a 0.0 second timer with tf2 respawnplayer, teleportentity them to the death vector, then people can farm them all day long and they cant do anything... You could kill them like 30 times a second.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 04-01-2013 at 01:14.
friagram 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 00:51.


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