Ok thanks stupok69. I understand how this works now.
I am having a problem though. I can see the box outlined in TE_BOX, but some reason it's not blocking my player. I have the solid type set to BBOX so the whole box I created should block the player.
The line...
"entity_set_size(ent, mins, maxs);"
should set the size to be blocked correct? Some reason it isn't working
btw I use engine as you can see : /
PHP Code:
ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "safebox_blue");
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY);
origin[0] = float(1663);
origin[1] = float(3411);
origin[2] = float(679);
entity_set_origin(ent, origin);
mins[0] = origin[0] - float(255);
mins[1] = origin[1] - float(115);
mins[2] = origin[2] - float(71);
maxs[0] = origin[0] + float(255);
maxs[1] = origin[1] + float(115);
maxs[2] = origin[2] + float(71);
entity_set_size(ent, mins, maxs); // This sets the blocking size?
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(31); // TE_BOX
write_coord(floatround(mins[0])); // boxmins
write_coord(floatround(mins[1]));
write_coord(floatround(mins[2]));
write_coord(floatround(maxs[0])); // boxmaxs
write_coord(floatround(maxs[1]));
write_coord(floatround(maxs[2]));
write_short(999999); // life in 0.1 s
write_byte(255); // r
write_byte(0); // g
write_byte(0); // b
message_end();