Raised This Month: $ Target: $400
 0% 

Pushable block?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 11-04-2007 , 10:30   Re: Pushable block?
Reply With Quote #1

The speed is 1 .. Try to make 100 or something

Code:
public Fwd_Touch(Ent, id) {  if(!is_user_connected(id) || !pev_valid(Ent))   return FMRES_IGNORED;    static szClassName[32];  pev(Ent, pev_classname, szClassName, maxchars(szClassName))    if(equal(szClassName, "bm_block"))  {   static iButton;   iButton = pev(id, pev_button)     if(iButton & IN_USE)   {    client_print(id, print_chat, "DEBUG Moving")      static Float:fAimVec[3];    velocity_by_aim(id, 100, fAimVec); //1 - Want to move the ent with player spped.    set_pev(Ent, pev_velocity, fAimVec);   }  }  return FMRES_IGNORED; }

Untested
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 11-04-2007 , 11:23   Re: Pushable block?
Reply With Quote #2

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)
}

Last edited by fxfighter; 11-04-2007 at 11:29.
fxfighter is offline
Send a message via MSN to fxfighter
Reply



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 01:15.


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