Can anyone please check out my code and figure out why hud_showmessage isn't showing up to the person who picked up the bomb? No errors are coming up in the server log when someone picks the bomb up.
Also, is there a way to show the message to everybody instead of just the player who picks it up? (I'm assuming in the "id" parameter of the "public bombpickup(id)" function that metamod is passing the id of the player who made the event fire in the first place? Is that how it works?)
Here's my code:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "mod_name_goes_here"
#define VERSION "1.0"
#define AUTHOR "author_name_goes_here"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("bombdrop", 3, "2=Dropped_The_Bomb");
register_logevent("bombpickup", 3, "2=Got_The_Bomb");
}
public bombdrop(id) {
//not written yet
return PLUGIN_CONTINUE;
}
public bombpickup(id) {
new players[32];
new num, i;
get_players(players, num, "e", "TERRORIST");
for(i = 1;i < num; i++) {
new weapons[32];
new numweapons, j;
get_user_weapons(i, weapons, numweapons);
for (j = 0; j < numweapons; j++) {
if (equal(weapons[j],"weapon_c4")) {
set_hudmessage(255, 0, 0, -1.0, 0.01)
show_hudmessage(id, "you picked up the bomb")
}
}
}
return PLUGIN_CONTINUE;
}
Thanks