![]() |
Re: Let's kill the bots
OK Fasten Seat Belts:
PHP Code:
Can you see something I've overseen? P.S also very important to note is that I'm having only one bot running at the same time (as you can see) the next bot gets called after the previous dies.... |
Re: Let's kill the bots
From where you got the data for the pointer current->pEdict ?
|
Re: Let's kill the bots
Initialized in ServerActivate()
|
Re: Let's kill the bots
Are you using array to get it in ClientConnect() ? Because if new bot join the pointer will be overwrited ?
|
Re: Let's kill the bots
Yep! I'm using an array of a struct called bot_t which holds pEdict.
also I omited ClientPutInServer() from BotCreate() so that they are spawned in StartFrame() |
Re: Let's kill the bots
ServerActivate() is not good to get bot edicts, you can't get the bots edicts at all from it, ClientPutInServer() is not usefull because you must call it for each bot, this function is not called auto when you create the bot with the engine. I suggest to do the edicts update and checks in start frame, and to spawn the bots in their own BotThink() function.
put that in the begining of start frame: Code:
for (int iPlayerIndex = 1; iPlayerIndex <= gpGlobals->maxClients; iPlayerIndex++) |
Re: Let's kill the bots
Hmmmmm , OK I'll re-check the rest of of my code ..
but how do you explain the fact that , when I replace ClienKill() with ClientPutInserver() in the above Code that the Bot gets successfully respawned ? |
Re: Let's kill the bots
Assuming that current->pEdict points to an invalid Entity or to another player , how is it possible that this same "invalid" pointer is fed to pfnPlayerMove() and results in the bot jumping , moving , shooting around successfully ?
|
Re: Let's kill the bots
ClientPutInServer() must be called only one time for each bot. Now you have all the bot edicts sotred in bots[32] loop this array and do the job.
|
Re: Let's kill the bots
You didn't answer my last question!
|
All times are GMT +2. The time now is 23:16. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.