-
关注Ta
-
- 注册时间 2007-01-11
- 最后登录 2019-10-27
-
- 发帖447
- 在线117小时
- 精华6
- DB19221
- 威望208
- 保证金0
- 桃子0
- 鲜花0
- 鸡蛋0
-
访问TA的空间加好友用道具
|
abc制作 - if(ent != NULL && isValidEnt(ent))
- {
- if(CalcScreen(ent->origin, drawhere))
- {
- pEngfuncs->pfnFillRGBA(drawhere[0] - 10, drawhere[1] - 10, 20,2,espr,espg,espb,200);
- pEngfuncs->pfnFillRGBA(drawhere[0] - 10, drawhere[1] - 10, 2,20,espr,espg,espb,200);
- pEngfuncs->pfnFillRGBA(drawhere[0] - 10, drawhere[1] + 10, 20,2,espr,espg,espb,200);
- pEngfuncs->pfnFillRGBA(drawhere[0] + 10, drawhere[1] - 10, 2,20,espr,espg,espb,200);
- DrawHudStringCenter(drawhere[0], drawhere[1] - 14, espr, espg, espb, nbuf);
- DrawHudStringCenter(drawhere[0], drawhere[1], espr, espg, espb, " C.C.A | %s ",gGetWeaponName(ent->curstate.weaponmodel));
- }
- }
- OR
- if(ent != NULL && isValidEnt(ent))
- {
- if(CalcScreen(ent->origin, drawhere))
- {
- pEngfuncs->pfnFillRGBA(drawhere[0] - 10, drawhere[1] - 10, 20,2,espr,espg,espb,200);
- pEngfuncs->pfnFillRGBA(drawhere[0] - 10, drawhere[1] - 10, 2,20,espr,espg,espb,200);
- pEngfuncs->pfnFillRGBA(drawhere[0] - 10, drawhere[1] + 10, 20,2,espr,espg,espb,200);
- pEngfuncs->pfnFillRGBA(drawhere[0] + 10, drawhere[1] - 10, 2,20,espr,espg,espb,200);
- if((drawhere[0] < centerX + 10 && drawhere[0] > centerX - 10) && (drawhere[1] < centerY + 10 && drawhere[1] > centerY - 10))
- {
- DrawHudStringCenter(drawhere[0], drawhere[1] - 14, espr, espg, espb, nbuf);
- DrawHudStringCenter(drawhere[0], drawhere[1], espr, espg, espb, " C.C.A | %s ",gGetWeaponName(ent->curstate.weaponmodel));
- }
- }
- }
- <++++++++++++++++++Overhead View Radar+++++++++++++++++
- void CalcAngle(const float *src, const float *dst, float *angles)
- {
- float delta[3] = { (src[0]-dst[0]), (src[1]-dst[1]), (src[2]-dst[2]) };
- float hyp = (float)sqrt(delta[0]*delta[0] + delta[1]*delta[1]);
-
- angles[0] = (float)(atan(delta[2] / hyp) * (180 / M_PI));
- angles[1] = (float)(atan(delta[1] / delta[0]) * (180 / M_PI));
- angles[2] = 0.0f;
- if(delta[0] >= 0.0f) { angles[1] += 180.0f; }
- }
- void MakeVector(float *angle, float *vector)
- {
- float pitch;
- float yaw;
- float tmp;
-
- pitch = (float)(angle[0] * M_PI/180);
- yaw = (float)(angle[1] * M_PI/180);
- tmp = (float)cos(pitch);
-
- vector[0] = (float) (-tmp * -cos(yaw));
- vector[1] = (float) (sin(yaw)*tmp);
- vector[2] = (float) -sin(pitch);
- }
- float GetFOVDistPlus(float *angle, float *src, float *dst)
- {
- float fov = 0.0f;
- float ang[3];
- float aim[3];
- float cross = 0.0f;
-
- // we get direction from the cross product...
- // cross.x = (A.y) * (B.z) - (B.y) * (A.z)
- // cross.y = (A.z) * (B.x) - (B.z) * (A.x)
- // cross.z = (A.x) * (B.y) - (B.x) * (A.y)
- CalcAngle(src, dst, ang);
- MakeVector(angle, aim);
- MakeVector(ang, ang);
- // cross[0] = (aim[1] * ang[2]) - (ang[1] * aim[2]);
- // cross[1] = (aim[2] * ang[0]) - (ang[2] * aim[0]);
- // cross[2] = (aim[0] * ang[1]) - (ang[0] * aim[1]);
- cross = (aim[0] * ang[1]) - (ang[0] * aim[1]);
- float mag_s = sqrt(SQUARE(aim[0]) + SQUARE(aim[1]));
- float mag_d = sqrt(SQUARE(ang[0]) + SQUARE(ang[1]));
- float u_dot_v = aim[0]*ang[0] + aim[1]*ang[1];
- fov = acos(u_dot_v / (mag_s*mag_d)) * (180 / M_PI);
- if(cross >= 0.0f) { fov *= -1.0f; }
-
- return fov;
- }
- void DrawRadar()
- {
- int x = Local.viewport[2];
- int y = Local.viewport[3];
- int w = Local.viewport[2] / 100;
- float ang[3];
- Aimbot.GetViewAngles(ang);
- glDisable(GL_TEXTURE_2D);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glColor4ub(0, 0, 0, 128);
- glBegin(GL_QUADS);
- glVertex2i(0, 0); //top
- glVertex2i(x, 0);
- glVertex2i(x, w);
- glVertex2i(0, w);
- glVertex2i(0, w); //left
- glVertex2i(w, w);
- glVertex2i(w, y-w);
- glVertex2i(0, y-w);
- glVertex2i(x-w, w); //right
- glVertex2i(x, w);
- glVertex2i(x, y-w);
- glVertex2i(x-w, y-w);
- glVertex2i(0, y-w); //bottom
- glVertex2i(x, y-w);
- glVertex2i(x, y);
- glVertex2i(0, y);
- glEnd();
- for(int ax=0; ax < Player.size(); ax++)
- {
- if(!Player[ax].valid) { continue; }
-
- int r,g,b;
- Player[ax].team->GetColours(r, g, b);
- float dist = GetFOVDistPlus(ang, Local.origin, Player[ax].ent->origin);
-
- float rx = 0.0f;
- float ry = 0.0f;
- int ix = 0;
- int iy = 0;
- if(dist >= -45.0f && dist <= +45.0f) //on top
- {
- ry = (float)w / 2.0f;
- rx = (dist+45.0f) / 90.0f * (float)x;
- }
- else if(dist < -45.0f && dist > -135.0f) //on left
- {
- rx = (float)w / 2.0f;
- ry = (float)y - ((dist + 135.0f) / 90.0f * (float)y);
- }
- else if(dist > +45.0f && dist < +135.0f) //on right
- {
- rx = (float)x - ((float)w / 2.0f);
- ry = (dist-45.0f)/90.0f * (float)y;
- }
- else //on bottom
- {
- ry = (float)y - ( (float)w / 2.0f);
- float part = (fabs(dist)-135.0f) / 45.0f;
- if(dist < 0.0f) { rx = (part*((float)x / 2.0f)); }
- else { rx = (float)x - (part*((float)x / 2.0f)); }
- }
- ix = (int)rx;
- iy = (int)ry;
- int icon = (w/2) - 2;
-
- glColor4ub(r, g, b, 200);
- glBegin(GL_QUADS);
- glVertex2i(ix-icon, iy-icon);
- glVertex2i(ix+icon, iy-icon);
- glVertex2i(ix+icon, iy+icon);
- glVertex2i(ix-icon, iy+icon);
- glEnd();
- glColor4ub(255, 255, 255, 160);
- glBegin(GL_LINE_STRIP);
- glVertex2i(ix-icon, iy+icon);
- glVertex2i(ix-icon, iy-icon);
- glVertex2i(ix+icon, iy-icon);
- glEnd();
- glColor4ub(0, 0, 0, 160);
- glBegin(GL_LINE_STRIP);
- glVertex2i(ix+icon, iy-icon);
- glVertex2i(ix+icon, iy+icon);
- glVertex2i(ix-icon, iy+icon);
- glEnd();
- }
-
- glEnable(GL_TEXTURE_2D);
- }__________________
- <++++++++++++++++++Player FOV On radar+++++++++++++++
- Vector CalcPViewAngles(int index){
- cl_entity_s *ent = gEngfuncs.GetEntityByIndex(index);
- Vector forward,right,up,newfwd;
- VectorCopy(ent->origin, newfwd);
- gEngfuncs.pfnAngleVectors(ent->angles, forward, right, up);
- // Thanks tetsuo :P im a tard
- newfwd = newfwd + forward * cvar.radar_fovdist; // radar_fovdist is an int, I use 300. change to suit your own taste
- return newfwd;
- }
- void drawRadarFOV(float* origin, int playerindex, int width, int r,int g,int b, int size)
- {
- int startX, startY, endX, endY;
- calcRadarPoint(origin, startX, startY);
- calcRadarPoint(CalcPViewAngles(playerindex), endX, endY);
- DrawLine(startX, startY, endX, endY, width, r, g, b, 255);
- }
- <++++++++++++++++++改变射击时烟雾的颜色+++++++++++++++
- if(cvar.weaponsmoke && me.alive)
- {
- cl_entity_t *curent;
- curent = pstudio->GetCurrentEntity();
- curent->curstate.rendercolor.r = 0;
- curent->curstate.rendercolor.g = 255;
- curent->curstate.rendercolor.b = 0;
- glBlendFunc(GL_FRONT_AND_BACK, GL_FILL);
- }
|