1. no out side linking
2. put this in the coding sub-forum
( @Raple @Color )
but anyways here is the code
Raw past data:Code: if (pCmd->buttons & IN_ATTACK) { float radius = 512.0f; C_BasePlayer *lp = UTIL_PlayerByIndex(1); C_BaseEntity *ents[256]; int ent_count = UTIL_EntitiesInSphere(ents, 256, lp->GetAbsOrigin(), radius, 0); int i = 0; for (i = 0; i < ent_count; i++) { if (ents[i] == NULL) continue; if (!ents[i]->IsAlive()) continue; if (!ents[i]->IsNPC()) continue; if (!ents[i]->IsVisible()) continue; if (ents[i]->IsDormant()) continue; if (ents[i]->GetMoveType() == MOVETYPE_NONE) continue; if (ents[i]->GetMoveType() == MOVETYPE_OBSERVER) continue; Vector aimpos; aimpos.Init(); aimpos = ents[i]->GetAbsOrigin(); QAngle attchangles; int attch = ents[i]->LookupAttachment("ValveBiped.Bip01_Head1"); if (attch > 0) ents[i]->GetAttachment(attch, aimpos, attchangles); QAngle aimang; aimang.Init(); aimpos = aimpos - EyePosition(); AngleVectors(aimang, &aimpos); pCmd->viewangles = aimang; } }
Code: if (pCmd->buttons & IN_ATTACK) { float radius = 512.0f; C_BasePlayer *lp = UTIL_PlayerByIndex(1); C_BaseEntity *ents[256]; int ent_count = UTIL_EntitiesInSphere(ents, 256, lp->GetAbsOrigin(), radius, 0); int i = 0; for (i = 0; i < ent_count; i++) { if (ents[i] == NULL) continue; if (!ents[i]->IsAlive()) continue; if (!ents[i]->IsNPC()) continue; if (!ents[i]->IsVisible()) continue; if (ents[i]->IsDormant()) continue; if (ents[i]->GetMoveType() == MOVETYPE_NONE) continue; if (ents[i]->GetMoveType() == MOVETYPE_OBSERVER) continue; Vector aimpos; aimpos.Init(); aimpos = ents[i]->GetAbsOrigin(); QAngle attchangles; int attch = ents[i]->LookupAttachment("ValveBiped.Bip01_Head1"); if (attch > 0) ents[i]->GetAttachment(attch, aimpos, attchangles); QAngle aimang; aimang.Init(); aimpos = aimpos - EyePosition(); AngleVectors(aimang, &aimpos); pCmd->viewangles = aimang; } }