Quote:
Originally Posted by The Storm
@tschumann Podbot_mm detect correctly light level of bots. Perhaps you can check out the code there.
|
I couldn't find it in Podbot MM (possibly they replaced it with the way in the thread I linked earlier?) but I found how it's done in Foxbot:
https://github.com/APGRoboCop/foxbot...bd889f/dll.cpp
PHP Code:
pPoint = CREATE_NAMED_ENTITY(MAKE_STRING("info_target"));
DispatchSpawn(pPoint);
pPoint->v.origin = pBot->enemy.ptr->v.origin;
pPoint->v.takedamage = DAMAGE_NO;
pPoint->v.solid = SOLID_NOT;
pPoint->v.owner = pBot->enemy.ptr;
pPoint->v.movetype = MOVETYPE_FLY; // noclip
pPoint->v.classname = MAKE_STRING("entity_botlightvalue");
pPoint->v.nextthink = gpGlobals->time;
pPoint->v.rendermode = kRenderNormal;
pPoint->v.renderfx = kRenderFxNone;
pPoint->v.renderamt = 0;
SET_MODEL(pPoint, "models/mechgibs.mdl");
amb = GETENTITYILLUM(pPoint);