View Single Post
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 02-18-2012 , 18:34   Re: Module: BMOD - Extended Physics Module
Reply With Quote #29

Look at my code, it's not working. Nothing happens when 2 balls collide:
Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <bmod>

public plugin_init() {
	register_plugin("bmod_test","0","asdf")
	register_concmd("bmod_test","_bmod_test")
}

public _bmod_test(id){
	new entity = create_entity("func_wall")
	entity_set_model(entity,"models/fyzsph.mdl")
	new Float:origin[3]
	entity_get_vector(id,EV_VEC_origin,origin)
	origin[2]+=128
	entity_set_origin(entity,origin)
	entity_set_float(entity,EV_FL_nextthink,86400.0)
	entity_set_int(entity,EV_INT_movetype,8)
	new Float:size[3] = {24.0,24.0,24.0}
	bmod_object_add(entity,BMOD_sphere,1.0,size)
	new Float:gravity[3] = {0.0,0.0,-2.0}
	bmod_object_set_vector(entity, BMOD_VEC_gravity, gravity)
	bmod_object_set_callback(entity,1)
}
public plugin_precache(){
	precache_model("models/fyzsph.mdl")
}

public bmod_forward_contact(ent1,ent2,Float:distance){
	client_print(0, print_chat, "ent1: %i; ent2: %i; distance: %f", ent1, ent2, distance)
}
Quote:
Originally Posted by Backup View Post
Is this bad 'feature'? Should every object call this callback automaticly?
Detecting collisions is a great feature but _set_callback may be an useless native.

I've looked at the source code and i don't see bmod_forward_contact. Did you forget it?
__________________

Last edited by mabaclu; 02-18-2012 at 18:54.
mabaclu is offline