alliedmodders / amxmodx

AMX Mod X - Half-Life 1 Scripting and Administration
http://www.amxmodx.org/
499 stars 203 forks source link

Is Not a Bot #753

Closed hashnimo closed 5 years ago

hashnimo commented 5 years ago

I have enabled bots with ReGameDLL and if a bot plants the bomb, I still get the chat output replaced with my own player name. Here's the code I have;

#include <amxmodx>

new name[32]
new message[256]

public plugin_init()
{
register_plugin("Planted", "0.1", "haZh")
}

public bomb_planted(id)
{
if (!is_user_bot(id))
{
get_user_name(id, name, charsmax(name))
client_print_color(0, print_chat, "^3%s ^1has planted the bomb", name)
}
}

Is this an issue in AMXX or what's wrong here?

SmileYzn commented 5 years ago

no, name variable will always be your name, never the name of bot lol

SmileYzn commented 5 years ago

You is a bot bro? it is logically will print your name rofl !! The problem itself is not your name, but bomb_planted using your id? If yes bug is valid, but even if is a bug will print your name

hashnimo commented 5 years ago

I have mentioned it wrongly in the above reply. Read the original question again. How does it print my name when a bot plants the bomb? I don't want it to print that message when a bot plants the bomb.

RauliTop commented 5 years ago

Really strange.

Check the id of the planter: https://www.amxmodx.org/api/csx/bomb_planted Is probably a csx module bug?

hashnimo commented 5 years ago

Exactly. Either my code is dumb or there's an AMXX bug that needs to be cleared. I was hoping that some expert would clarify if they get the same results running the above, but got 2 retards to thumbs it down lmao!

Arkshine commented 5 years ago

The way this forward works is:

The planter's id is always set when you starts planting. I'm not sure how it's possible bomb_planted passes your id when a bot plants the bomb.

Note: I've tested myself with ReGameDLL under windows and the forward worked as expected.

Please add debug and try again yourself, then see if you can reproduce the issue. If you can, please explain what you did exactly and eventually PM me with your zipped addons folter so I can test it as it is.

public bomb_planting(id)
{
    log_amx("[bomb_planting] id = %d (%n), bot = %s", id, id, is_user_bot(id) ? "yes" : "no");
}

public bomb_planted(id)
{
    log_amx("[bomb_planted] id = %d (%n), bot = %s", id, id, is_user_bot(id) ? "yes" : "no");
}
hashnimo commented 5 years ago

Note: I've tested myself with ReGameDLL under windows and the forward worked as expected.

That's all I wanted to hear. At last some expert with sufficient knowledge has look into this. So this isn't an AMXX issue, probably it's because that I'm using Re-AMX Mod X and not the official version. Or it's all because of some changes that I have made to the server files. Either way, thank you!

Arkshine commented 5 years ago

Please don't use outdated AMXX version. Most of fixes in ReAMXX are already in the latest 1.9/1.10 builds.