hello, this may be more specific to Valve..

my dll loads between the tfc.dll and the HL engine so that is why it
references entities, but anyways, the following code will give me the weapon
in my inventory but for some reason i am unable to select the weapon no
matter what.. any ideas on what to do?

void ds_givenameditem ( edict_t *pEntity, const char *pszName ) {

 if(EntInfo[ENTINDEX(pEntity)].level>=1&&CVAR_GET_FLOAT("ds_give")!=0) {

  if ( stristr(pszName, "tf_weapon") !=0 || stristr(pszName, "item_") !=0 ||
stristr(pszName, "item_artifact_super_damage") !=0 || stristr(pszName,
"item_artifact_invulnerability") !=0) {

   int istr = MAKE_STRING(pszName);

   edict_t *pent;

   pent = CREATE_NAMED_ENTITY(istr);

   if ( FNullEnt( pent ) ) {

    ClientPrint(VARS(pEntity), HUD_PRINTCONSOLE, "> invalid item to
give\n");

   } else {
    /*
    if (stristr(pszName, "tf_weapon")) {

     ds_givenameditem (pEntity, "item_shells");
     ds_givenameditem (pEntity, "item_cells");
     ds_givenameditem (pEntity, "item_rockets");
     ds_givenameditem (pEntity, "item_nails");


    }
    */

    VARS( pent )->origin = pEntity->v.origin;

    //ClearBits(pent->v.spawnflags, SF_NORESPAWN);

    pent->v.spawnflags |= SF_NORESPAWN;

    DispatchSpawn( pent );
    DispatchTouch( pent, ENT( pEntity ) );

   }

  } else {

   ClientPrint(VARS(pEntity), HUD_PRINTCONSOLE, "> you did not specify a
weapon\n");

  }

 }

}

i tried giving the player ammo before he gets the weapon but it still
doesn't make a difference.

thanks,

christian



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

Reply via email to