AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Please Help (https://forums.alliedmods.net/showthread.php?t=9728)

xerogenesis 01-28-2005 22:19

Please Help
 
This is a modification of asskicr's admin wall plugin (v 1.0 not 2.0 which is released on these forums) edit was not done by myself, obviously this plugin was originally intended to be used with amx 0.9.9 not amxx

I compiled the following sma with amxx's newest compiler but every time i use the unwall command the server locks up creating the walls works but as soon as i try to destroy them is when the server freezes up

Code:

#include <amxmod>
#include <amxmisc>
#include <Vexd_Utilities> 

new wall
//----------------------------------------------------------------------------------------------
public plugin_init(){
  register_plugin("Wall","1.0","AssKicR")
  register_concmd("amx_wall","Ass_acc_wall",ADMIN_SLAY)
  register_concmd("amx_unwall","Ass_acc_unwall",ADMIN_SLAY)
  register_cvar("wall_radius", "1" )
  register_cvar("wall_maxdamage", "0" )
  return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public plugin_precache() {
  precache_model("models/wall.mdl")

  return PLUGIN_CONTINUE
  }
//----------------------------------------------------------------------------------------------
public Ass_acc_wall(id,level,cid) {
  if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
  Ass_wall(id)
  return PLUGIN_HANDLED
}
public Ass_acc_unwall(id,level,cid) {
  if (!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED
  Ass_unwall(id)
  return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public Ass_unwall(id) {

        new iCurrent
        iCurrent = FindEntity(-1,"coool_wall")

        while(iCurrent != -1) {
                RemoveEntity(iCurrent)
                iCurrent = FindEntity(-1,"coool_wall")
        }
        client_print(id,print_chat,"**** Wall Removed ****")
        return PLUGIN_CONTINUE
}

public Ass_wall(id) {

  if (!is_user_alive(id)) {
        client_print(id,print_chat,"**** Wall Placement Denied ****")
        return PLUGIN_HANDLED
  } else {
        wall = CreateEntity("info_target")
        if(wall == 0) return PLUGIN_HANDLED_MAIN

        entity_set_string(wall, EV_SZ_classname, "coool_wall")
        entity_set_model(wall, "models/wall.mdl")
        entity_set_float(wall, EV_FL_health, 1000.0)

        new Float:PlayerOrigin[3]
        entity_get_vector(id, EV_VEC_origin, PlayerOrigin)
        PlayerOrigin[2]-=20

        entity_set_origin(wall, PlayerOrigin)

        entity_set_int(wall, EV_INT_solid, SOLID_BBOX)   
        entity_set_int(wall, EV_INT_movetype, MOVETYPE_FLY)
        entity_set_edict(wall, EV_ENT_owner, id)

        new Float:vRetVector[3]
        entity_get_vector(id, EV_VEC_v_angle, vRetVector)
        vRetVector[0]=float(0)
        entity_set_vector(wall, EV_VEC_angles, vRetVector)

        if( ((vRetVector[1]>=45.0) && (vRetVector[1]<=135.0)) || ((vRetVector[1]>=-135.0) && (vRetVector[1]<=-45.0)) )
                entity_set_size(wall, Float:{-90.0,-5.0,-156.0}, Float:{90.0,5.0,156.0} )
        else /*if( ((vRetVector[1]>-45.0) && (vRetVector[1]<45.0)) || ((vRetVector[1]>135.0) && (vRetVector[1]<-135.0)) )*/
                entity_set_size(wall, Float:{-5.0,-90.0,-156.0}, Float:{5.0,90.0,156.0} )

        client_print(id,print_chat,"**** Wall Placed ****") 
  }
  return PLUGIN_CONTINUE
}

p.s.

i had it working flawlessly on the old release of amxx

xerogenesis 01-30-2005 01:25

im not wondering if this is somehow related to the engine module


All times are GMT -4. The time now is 19:20.

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