Raised This Month: $ Target: $400
 0% 

How to set enitity's body


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-27-2010 , 20:52   How to set enitity's body
Reply With Quote #1

Code:
public set_mine(id) {
  new Float:StartOrigin[3]

 
  new PlayerOrigin[3]
  get_user_origin(id, PlayerOrigin, 1)

  StartOrigin[0] = float(PlayerOrigin[0])
  StartOrigin[1] = float(PlayerOrigin[1])
  StartOrigin[2] = float(PlayerOrigin[2]-60)

  new MineEnt = create_entity("info_target")
  
  entity_set_string(MineEnt, EV_SZ_classname, "landmine")
  entity_set_model(MineEnt, "models/w_landmine_zlw.mdl")
  entity_set_origin(MineEnt, StartOrigin)

  entity_set_int(MineEnt, EV_INT_solid, 2)
  entity_set_edict(MineEnt, EV_ENT_owner, id)


}
For some reasons it doesn't react for:

Code:
public pfn_touch(ptr, ptd) {
new ClassName[32]



if(!pev_valid(ptr))
	return FMRES_IGNORED;

if ((ptr > 0) && is_valid_ent(ptr))
    entity_get_string(ptr, EV_SZ_classname, ClassName, 31)
  

static toucherClass[32];
pev(ptd, pev_classname, toucherClass, 31);
if(equal(ClassName, "landmine") && equal(toucherClass, "player"))
{

client_print(0,print_chat,"Umba umba!")
remove_entity(ptr)

}
It seems like the mine has no body, I wonder how could I fix it? How can i make the mine "touchable"?
Gadzislaw007 is offline
 



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


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