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

Bot didn't move


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vamvam
Junior Member
Join Date: Jan 2016
Old 11-18-2017 , 14:38   Bot didn't move
Reply With Quote #1

Hello guys,

can anyone tell me why my bots cannot move? I spawned it with this code:

new float:spawn[] = { 1339.56, 7013.35, 4320.03};
int ent = CreateFakeClient("test");
ChangeClientTeam(ent, 2);
CS_RespawnPlayer(ent);
TeleportEntity(ent, spawn, NULL_VECTOR, NULL_VECTOR);
vamvam is offline
hmmmmm
Great Tester of Whatever
Join Date: Mar 2017
Location: ...
Old 11-19-2017 , 00:44   Re: Bot didn't move
Reply With Quote #2

Try using "bot_add" and "bot_quota" instead of CreateFakeClient, I've heard that using that can cause some issues.
hmmmmm is offline
vamvam
Junior Member
Join Date: Jan 2016
Old 11-19-2017 , 05:47   Re: Bot didn't move
Reply With Quote #3

I tried that and it works, but problem is i cannot get ID of this bot what i spawned. Then i need to somehow load BotControll i think to this entity but idk how.
vamvam is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 11-19-2017 , 12:33   Re: Bot didn't move
Reply With Quote #4

Native CreateFakeClient spawn FakeClient without AI
Vit_amin is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 11-19-2017 , 13:48   Re: Bot didn't move
Reply With Quote #5

hook player_spawn or use onclientputinserver
check to see if its a fake client and get the bot index that way?
__________________
8guawong is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-19-2017 , 16:46   Re: Bot didn't move
Reply With Quote #6

OnClientPutInServer most likely gets called during bot_add.

Simply set a flag before bot_add and grab the index from OnClientPutInServer.
__________________
Neuro Toxin is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 11-20-2017 , 02:45   Re: Bot didn't move
Reply With Quote #7

If you're just looking for any bots joining, there's a special Steam ID for bots that you can check for in OnClientAuthorized.

From memory, it's just
Code:
BOT
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 11-20-2017 at 02:46.
Powerlord is offline
vamvam
Junior Member
Join Date: Jan 2016
Old 11-24-2017 , 03:15   Re: Bot didn't move
Reply With Quote #8

Thanks for answers.

Your ideas are good, i tried it, but it's so buggy if i try to put more bots(sometimes it change names only for 4 bots of 6 or if some players join it change id of players and bot and then it change player name to "bot ...") but i get a better solution, or idk if it better solution but for my plugin it is. I just spawn it and then hold it with some seconds, then check all the players and give bots his name without id, just do it in real time.. It works well, it's not exactly what I wanted, but I made a compromise. So thank u for your helping!
vamvam is offline
Reply


Thread Tools
Display Modes

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 10:05.


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