Yes, I am trying to get into scripting starting off by editing others plugins, and this one kinda intrigued me, but there was a few things I didn't like. This specific Bazooka plugin doesn't allow users to buy bazookas on defusion maps, because of this line
PHP Code:
public handle_say(id) {
new command[32]
read_argv(1, command, 31)
if (equal(command, "/buybazooka")) {
if (find_ent_by_class(-1, "func_bomb_target") == 0) {
if (is_user_alive(id)) {
if (get_cvar_num("amx_bazooka_buyable") == 1) {
show_buymenu(id)
}
else {
client_print(id, print_
chat, "[Bazooka] The buymenu is disabled!")
}
}
else {
client_print(id, print_chat, "[Bazooka] You cannot buy a bazooka while you are dead!")
}
}
else {
client_print(id, print_chat, "[Bazooka] The bazooka is disabled on this map!")
}
}
Do you mind explaining this? I get it partially, like if this is this, then this happens .. sorta .. I just dont complately understand the codeing, like "find_ent_by_class" .. whats that mean? And also, the entire command to together:
if (find_ent_by_class(-1, "func_bomb_target") == 0) {
Whats the -1 mean? .. Thats why I'm asking if you could just explain everything basicly .. that is in the code above.
AlsoWhat can be done to edit this to make it usable on defusion maps?
I tried taking it out complately but got a few error messages upon compiling.
I aslo tried just taking out only this line:
PHP Code:
if (find_ent_by_class(-1, "func_bomb_target") == 0) {
You get a compiling error 010: invalid function or declaration
Anyone know ?
__________________