Let's begin with your presentation:
1.Naming it "C4 Bot Taker" it's misleading, since it works for humans too. Try something more generic, like "C4 Taker", you decide. Fix your description too.
2.Copy-pasting the code in your post is useless and can create confusion. Attaching the sma file is enough.
About your code, it's horrible.
PHP Code:
register_cvar("c4bt_take_from_humans", "0") //set to '1' to enable to take C4 from human players
register_cvar("c4bt_max_distance", "200") //max distance for the take
register_cvar("c4bt_hud", "5") //number of instances the HUD Message appears. Set to '0' to disable. Can be set to '9999...'.
Such long time since I saw something like this. Use pcvars, that's a base rule if you want your plugin approved, they are faster. What you have to do is to save the return value of
register_cvar in a variable and switch from
get_cvar_num("cvar_name") to
get_pcvar_num(variable_that_store_cvar_pointe r).
Example:
PHP Code:
new cvar = register_cvar("my_cvar", "100")
get_pcvar_num(cvar)
In
EventStatusValue_PlayerID,
is_user_alive(id) should be put at the beginning of the function. One thing that I don't get is why do you use
get_user_aiming when you already know the player that you are aiming at from
read_data(2).
Also fix your check, message will be show only for bots and never for humans. If you update your plugin, update it properly.
Is never used.
Start with this.
__________________