View Single Post
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 02-19-2009 , 18:55   Re: Bot Apology for TK
Reply With Quote #8

Quote:
Originally Posted by arkshine View Post
Here some thoughts :

- g_sorry_phrases <= use const before since it's something constant and don't harcode '6', no need.
- Since it's for bots, you should not use Ham, if the bot's classname is not "player" it will not work. More appropriate to use DeathMsg event which is perfectly fine.
- Cache the value of is_user_bot(). Just save it into a var in client_putinserver().
- Doing a check if victim/killer is connected in the death function is useless here.
- Don't check if task exists, no need here, you can remove directly.
- set_task ; why did you pass the killer id ? The message will be showed only for the killer and not the victim. I think this message should be showed for all players, so using 0.
- In say_sorry() function, the check for bot is useless ; same for is_user_connected assuming you pass 0, and you engclient_cmd() should be : engclient_cmd(0,"say %s",g_sorry_phrases[random_num(0, sizeof g_sorry_phrases - 1)])

Did you test your plugin ? :s
If you want it perfect, add also enableham/disableham if there are bots or not, in the server.

Edit: arkshine, why would the classname be other than "player"?
__________________

Last edited by joaquimandrade; 02-19-2009 at 18:58.
joaquimandrade is offline