Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

checkextension

From Quake Wiki

Revision as of 16:58, 28 March 2013 by Spirit (talk | contribs) (Spirit moved page Checkextension to checkextension: lowercase)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Builtin:

float(string s) checkextension = #99;

Description:

Check if (cvar("pr_checkextension")) before calling this, this is the only guaranteed extension to be present in the extension system, it allows you to check if an extension is available, by name, to check for an extension.

Use QC code like this:

if (cvar("pr_checkextension"))
if (checkextension("DP_SV_SETCOLOR"))
	ext_setcolor = TRUE;

It is recommended this code be placed in worldspawn or a worldspawn called function somewhere, from then on you can check ext_setcolor to know if that extension is available.