havent tryed it your code yet becase it dont like to install bm to run it-.-
so i added a litle code to create a block ingame but dont remb how to make it(unable to walk thro)
Code:
#include <amxmodx>
#include <fakemeta>
new block_mdl[] = "models/bm_block_platform.mdl"
public plugin_init() {
register_plugin("Pushable Block", "1.0", "Alka");
register_clcmd("say /create","create")
register_clcmd("say_team /create","create")
register_forward(FM_Touch, "Fwd_Touch");
}
public Fwd_Touch(Ent, id)
{
if(!is_user_connected(id) || !pev_valid(Ent))
return FMRES_IGNORED;
static ClassName[32];
pev(Ent, pev_classname, ClassName, sizeof ClassName - 1);
if(equal(ClassName, "bm_block"))
{
static Button;
Button = pev(id, pev_button);
if(Button & IN_USE)
{
client_print(id, print_chat, "debug: Mooving..."); //Debug. :P
static Float:AimVec[3];
//velocity_by_aim(id, 1, AimVec); //1 - Want to move the ent with player spped.
engfunc(EngFunc_GetAimVector, id, 1.0, AimVec); //Fakemeta style. :D
//Both not working. :S
set_pev(Ent, pev_velocity, AimVec);
}
}
return FMRES_IGNORED;
}
public create(id)
{
new Ent = engfunc(EngFunc_CreateNamedEntity,engfunc(EngFunc_AllocString,"info_target"))
new Float:origin[3]
pev(id,pev_origin,origin)
engfunc(EngFunc_SetOrigin,Ent,origin)
origin[2] += 100.0
engfunc(EngFunc_SetOrigin,id,origin)
set_pev(Ent,pev_classname,"bm_block")
engfunc(EngFunc_SetModel,Ent,block_mdl)
set_pev(Ent,pev_solid,SOLID_TRIGGER)
new name[32]
get_user_name(id,name,31)
client_print(0, print_chat, " %s has created a block",name)
}
public plugin_precache()
{
precache_model(block_mdl)
}