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

Difference between revisions of "checkextension"

From Quake Wiki

(New page: '''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 ...)
 
m (Spirit moved page Checkextension to checkextension: lowercase)
 
(No difference)

Latest revision as of 16:58, 28 March 2013

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.