Ok, here is a small bit of code, that I am using to detect a keyvalue in
the maps worldspawn section. Now what it does, is finds the key
"defaultctf" then sets a value in the mod to reflect what is finds. Now I
know it works, because as I changelevel maps, the value of oz_defaultctf
does change, but where I am getting stuck, is that I need it to change back
to 0 if there is no key present. The first is present in op4ctf maps, the
second is present in the OZ ctf maps, but in a normal DM map, that key is
not there. This key changes the games rules, and it gets stuck at the last
value read in. Now I realize the last value will not get called by a map
that does not have the key, it is just there for error handling, as right
now I only need 1 or 2. I tried adding a CVAR_SET_FLOAT to set it back to 0
in a few places, but it always seems to get set to 0 and never use the one
in the map. I cannot for the life of me figure out where to reset it???
Any help would be much appreciated, or even a what the hell are you
thinking. 8)
Thanks,
Dave R. Meyers
aka Starbreaker
www.starbraker.com
Lead Coder Oz Deathmatch
else if ( FStrEq(pkvd->szKeyName, "defaultctf"))
{
if ( atoi(pkvd->szValue) )
{
if ((atoi(pkvd->szValue)) == 1)
{
CVAR_SET_FLOAT( "oz_defaultctf", 1);//(atoi(pkvd->szValue)) );
}
else if ((atoi(pkvd->szValue)) == 2)
{
CVAR_SET_FLOAT( "oz_defaultctf", 2);//(atoi(pkvd->szValue)) );
}
}
else
{
CVAR_SET_FLOAT( "oz_defaultctf", 0 );
}
pkvd->fHandled = TRUE;
}
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders