For figuring out models, you should indeed look at the model. Here a
snippet:

// return team number 0 through 3 based what MOD uses for team numbers
int UTIL_GetTeam(edict_t *pEntity)
{
   if (mod_id == CSTRIKE_DLL)
   {
      char *infobuffer;
      char model_name[32];

      infobuffer = (*g_engfuncs.pfnGetInfoKeyBuffer)( pEntity );
      strcpy(model_name, (g_engfuncs.pfnInfoKeyValue(infobuffer,
"model")));

      if ((strcmp(model_name, "terror") == 0) ||  // Phoenix Connektion
          (strcmp(model_name, "arab") == 0) ||    // old L337 Krew
          (strcmp(model_name, "leet") == 0) ||    // L337 Krew
          (strcmp(model_name, "artic") == 0) ||   // Artic Avenger
                  (strcmp(model_name, "arctic") == 0) ||   // Artic
Avenger - fix for arctic? - seemed a typo?
          (strcmp(model_name, "guerilla") == 0))  // Gorilla Warfare
      {
                  return 0;
      }
      else if ((strcmp(model_name, "urban") == 0) ||  // Seal Team 6
               (strcmp(model_name, "gsg9") == 0) ||   // German GSG-9
               (strcmp(model_name, "sas") == 0) ||    // UK SAS
               (strcmp(model_name, "gign") == 0) ||   // French GIGN
               (strcmp(model_name, "vip") == 0))      // VIP
      {
         return 1;
      }
      return -1;  // return zero if team is unknown
   }

   return 0;
}


As you can see, you can figure out the VIP here as well.

Recommended is to do the above check pretty often as people switch teams
all the time.

Objective related entities:

Bombspot entities:
func_bomb_target
info_bomb_target

Rescue zone Hostages:
func_hostage_rescue

Counter-Terrorist player start:
info_player_start

Terrorist player start:
info_player_deathmatch

To know where the bomb is (dropped C4)
    // ------------------
    // Update: Dropped C4
    // ------------------
    // Its not dropped unless stated otherwise.
    vDroppedC4 = Vector(9999,9999,9999);

    // Find the dropped bomb
    while ((pEnt = UTIL_FindEntityByClassname(pEnt, "weaponbox" )) !=
NULL)
    {
        // when DROPPED C4
        if ((FStrEq(STRING(pEnt->v.model), "models/w_backpack.mdl")))
        {
            vDroppedC4 = pEnt->v.origin; // this is the origin.

            break;
        }
    }

To identify grenade types (including planted C4)
//////////////////////////////////
// UTIL_getGrenadeType function // - Stefan
//////////////////////////////////
int UTIL_GetGrenadeType(edict_t *pEntity)
{

        char model_name[32];

        strcpy(model_name, STRING(pEntity->v.model));

        if (strcmp(model_name, "models/w_hegrenade.mdl") == 0)
                return 1;               // He grenade
        if (strcmp(model_name, "models/w_flashbang.mdl") == 0 )
                return 2;               // FlashBang
        if (strcmp(model_name, "models/w_smokegrenade.mdl") == 0)
                return 3;               // SmokeGrenade
        if (strcmp(model_name, "models/w_c4.mdl") == 0)
                return 4;               // C4 Explosive

        return 0;

}

So, if you find a grenade entity with the models/w_c4.mdl model, then
you can be pretty sure it is the planted bomb.


Hope this helps ya a bit.

S. Hendriks
RealBot (http://realbot.bots-united.com)

-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Brian A. Stumm
Verzonden: maandag 26 januari 2004 2:24
Aan: [EMAIL PROTECTED]
Onderwerp: [hlcoders] cstrike, Team, Model and Game Modes...



I'm working on a hlwebtv style project. I've got full support finished
for dod and tfc along with the basics for deathmatch style mods. But
having CS support for teams, class/model and the various game
objects/entities seems pretty important since its the most popular mod.
Prob is I dont play CS at all...

I expected some things to work out the game and they didn't...

tfc and dod both use:

v.playerclass and v.team for model and team respectively. These are '0'
in cs no matter what team or model I choose. ???

In some hunting I found this:

g_engfuncs.pfnInfoKeyValue ((*g_engfuncs.pfnGetInfoKeyBuffer) (pEntity),
"model")

It seems to work for model... Is that my only option? there is no
v.VARIABLE equiv?

Anyone know what to do for team? Only help I've buggered up so far is
track when they change and store it yourself. That seems crazy...

Last... Game Types?

Are the only game object related entities a VIP, Hostages and the Bomb?

I've seen two c4 related entities... two entites for hostages (one must
be the droppoff point it has no model value) but have yet to see
anything about vip but I just started looking into CS today.

Any help in the CS area is appreciated...


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders




_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to