Hey guys. Question mostly geared to R1CH.
I'm having trouble with configstrings. I need to store a string in a configstring because my HUD system uses stat_string, but for some reason I can't get more than one string in here. I tried this first:
{
char *pistolammostring = gi.TagMalloc (sizeof(char *), TAG_GAME);
char *shammostring = gi.TagMalloc (sizeof(char *), TAG_GAME);
pistolammostring = va(" %i/200",ent->client->pers.inventory[ITEM_INDEX(FindItem("Pistol Ammo"))]);
shammostring = va(" %i/50",ent->client->pers.inventory[ITEM_INDEX(FindItem("Shells"))]);
gi.configstring (CS_GENERAL+playernum, pistolammostring);
ent->client->ps.stats[STAT_DUKE_PISTOLAMMO] = CS_GENERAL+playernum;
gi.configstring ((CS_GENERAL+playernum)+sizeof(pistolammostring), shammostring);
ent->client->ps.stats[STAT_DUKE_SHOTGUNAMMO] = (CS_GENERAL+playernum)+sizeof(pistolammostring);
}
Failed horribly. Tried this:
{
char *pistolammostring = gi.TagMalloc (sizeof(char *), TAG_GAME);
char *shammostring = gi.TagMalloc (sizeof(char *), TAG_GAME);
pistolammostring = va(" %i/200",ent->client->pers.inventory[ITEM_INDEX(FindItem("Pistol Ammo"))]);
shammostring = va(" %i/50",ent->client->pers.inventory[ITEM_INDEX(FindItem("Shells"))]);
gi.configstring (CS_GENERAL+playernum, pistolammostring);
ent->client->ps.stats[STAT_DUKE_PISTOLAMMO] = CS_GENERAL+playernum;
gi.configstring ((CS_GENERAL+playernum)+1, shammostring);
ent->client->ps.stats[STAT_DUKE_SHOTGUNAMMO] = (CS_GENERAL+playernum)+1;
}
but it just override other people if they joined.
Any ideas or other type of HUD token I could use?
-Paril