Hello everybody,

I want to place a building in a fps shooter. The building should be a few quants in front of the player and when its in a wall or in an other building, it should be red and otherwise it should be green (So that you can see if you can build it there or not).

My question: why doesn't it become red when its in a wall?
Here's the code ("ich" is the pointer to the player)


Code:
function Gebaeude_bauen() {
	my = ent_createlocal("Geschuetz.mdl",vector(ich.x + 100 * cos(ich.pan), ich.y + 100 * sin(ich.pan), ich.z), Geschuetz);

	wait(1);
	c_setminmax(my);
	
	set(my, TRANSLUCENT |LIGHT);
	
	my.alpha = 50;
	
	while (!Taste_bestaetigen) {
		
		my.x = ich.x + 100 * cos(ich.pan);
		my.y = ich.y + 100 * sin(ich.pan);
		
		if (my.floor_dist > 0)
			c_move(my, nullvector, vector(0, 0, -my.floor_dist), 0);
		if (my.floor_dist < 0)
			c_move(my, nullvector, vector(0, 0, my.floor_dist), 0);
		
		if(in_solid) {
			my.green = 0;
			my.red = 255;
		}
		else {
			my.green = 255;
			my.red = 0;
		}
		
		if (Taste_abbrechen) {
			ptr_remove(my);
			return;
		}
		wait(1);
	}
	
		my = ent_create("Geschuetz.mdl", my.x, Geschuetz);
}




Last edited by Toryno; 04/15/09 00:03.

Thanks for reading, thinking, answering wink