-
关注Ta
-
- 注册时间 2004-07-09
- 最后登录 2008-01-25
-
- 发帖1257
- 在线1135小时
- 精华8
- DB29513
- 威望2067
- 保证金0
- 桃子0
- 鲜花0
- 鸡蛋0
-
访问TA的空间加好友用道具
|
ESP based off the sequences of models. Thanks to boecke for the sequences (Tetsuo's or OGCs I think..) Code: int Cstrike_GaitSequenceInfo[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0..9 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, // 10..19 1, 2, 0, 1, 1, 2, 0, 1, 1, 2, // 20..29 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, // 30..39 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, // 40..49 2, 0, 1, 2, 0, 0, 0, 8, 0, 8, // 50..59 0, 16, 0, 16, 0, 0, 1, 1, 2, 0, // 60..69 Updates thanks to Tetsuo <3 1, 1, 2, 0, 1, 0, 1, 0, 1, 2, // 70..79 0, 1, 2, 32, 40, 32, 40, 32, 32, 32, // 80..89 33, 32, 33, 34, 64, 4, 34, 32, 32, 4, // 90..99 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 100..109 4 // 110 };
enum { SEQUENCE_IDLE = 0, SEQUENCE_SHOOT = 1, SEQUENCE_RELOAD = 2, SEQUENCE_DIE = 4, SEQUENCE_THROW = 8, SEQUENCE_ARM_C4 = 16, SEQUENCE_SHIELD = 32, SEQUENCE_SHIELD_SIDE = 64 }; You can make this a long way, or you can shorten it up in a char for good measure code: char* gaitSequences[] = { "Standing", "Shooting", "Reloading", "Dead", "Throwing", "Arming C4!", "Using Shield!", "Shield(NotInUse)" }; Main function, thanks to boecke for it. (Modified by me)
static void DrawGaitSequenceEsp() { float drawhere[2]; int espr,espg,espb; char nbuf[1024]; cl_entity_t *ent, *pLocal = pEngfuncs->GetLocalPlayer(); hud_player_info_t pinfo; for(int i = 0; i < 33; i++) { int atype = Cstrike_GaitSequenceInfo[ent->curstate.gaitsequence]; if(i == pLocal->index) continue; cl_entity_s *ent = pEngfuncs->GetEntityByIndex(i); pEngfuncs->pfnGetPlayerInfo(i, &pinfo);
if(ent != NULL && bIsValidEnt(ent)) { if(CalcScreen(ent->origin, drawhere)) sprintf(nbuf,"%s",pinfo.name); float drawhere[2]; CalcScreen(ent->origin, drawhere); { sprintf(nbuf,"%s",pinfo.name); CalcScreen(ent->origin, drawhere); int namelen; namelen = strlen(nbuf); if( strstr( pinfo.model, "arctic" ) || strstr( pinfo.model, "guerilla" ) || strstr( pinfo.model, "leet" ) || strstr( pinfo.model, "terror" ) ) { espr = 255; espg = 0; espb = 0; } else if( strstr( pinfo.model, "gign" ) || strstr( pinfo.model, "gsg9" ) || strstr( pinfo.model, "sas" ) || strstr( pinfo.model, "urban" ) || strstr( pinfo.model, "vip" )) { espr = 0; espg = 0; espb = 255; } DrawHudString(drawhere[0] - namelen * 2, drawhere[1] - 140, espr, espg, espb, "-%s-", gaitSequences[atype]); } } } } Call in HUD_Redraw or somewhere that gets called every 5th Viewport.
Couch.
Not tested as usual, I have no command over what happens to your computer.
-Couch
|