Raised This Month: $ Target: $400
 0% 

Unable to use on defuse/& other code questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KingCommentor
Senior Member
Join Date: Jan 2008
Location: Floridaaaa
Old 07-31-2008 , 18:06   Unable to use on defuse/& other code questions
Reply With Quote #1

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(1command31)
  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(idprint_
chat
"[Bazooka] The buymenu is disabled!")
        }
      }
      else {
        
client_print(idprint_chat"[Bazooka] You cannot buy a bazooka while you are dead!")
      }
    }
    else {
      
client_print(idprint_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 ?
__________________
+Karma is appreciated! |Be PROUD, leave your name!

Last edited by KingCommentor; 07-31-2008 at 22:36.
KingCommentor is offline
Send a message via AIM to KingCommentor
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode