1 //////////////////////////////////////////////////
3 //////////////////////////////////////////////////
4 // AK FIXME: Create perhaps a special builtin file for the common cmds
6 void checkextension(string ext) = #1;
9 void error(string err,...) = #2;
10 void objerror(string err,...) = #3;
14 void print(string text,...) = #4;
15 void bprint(string text,...) = #5;
16 void sprint(float clientnum, string text,...) = #6;
17 void centerprint(string text,...) = #7;
21 vector normalize(vector v) = #8;
22 float vlen(vector v) = #9;
23 float vectoyaw(vector v) = #10;
24 vector vectoangles(vector v) = #11;
26 float random(void) = #12;
28 void cmd(string command) = #13;
32 float cvar(string name) = #14;
33 const string str_cvar(string name) = #71;
34 void cvar_set(string name, string value) = #15;
36 void dprint(string text,...) = #16;
38 // conversion functions
40 string ftos(float f) = #17;
41 float fabs(float f) = #18;
42 string vtos(vector v) = #19;
43 string etos(entity e) = #20;
45 float stof(string val,...) = #21;
47 entity spawn(void) = #22;
48 void remove(entity e) = #23;
50 entity findstring(entity start, .string _field, string match) = #24;
51 entity findfloat(entity start, .float _field, float match) = #25;
52 entity findentity(entity start, .entity _field, entity match) = #25;
54 entity findchainstring(.string _field, string match) = #26;
55 entity findchainfloat(.float _field, float match) = #27;
56 entity findchainentity(.entity _field, entity match) = #27;
58 string precache_file(string file) = #28;
59 string precache_sound(string sample) = #29;
61 void crash(void) = #72;
62 void coredump(void) = #30;
63 void stackdump(void) = #73;
64 void traceon(void) = #31;
65 void traceoff(void) = #32;
67 void eprint(entity e) = #33;
68 float rint(float f) = #34;
69 float floor(float f) = #35;
70 float ceil(float f) = #36;
71 entity nextent(entity e) = #37;
72 float sin(float f) = #38;
73 float cos(float f) = #39;
74 float sqrt(float f) = #40;
75 vector randomvec(void) = #41;
77 float registercvar(string name, string value, float flags) = #42; // returns 1 if success
78 float min(float f,...) = #43;
79 float max(float f,...) = #44;
80 float bound(float min,float value, float max) = #45;
81 float pow(float a, float b) = #46;
82 void copyentity(entity src, entity dst) = #47;
84 float fopen(string filename, float mode) = #48;
85 void fclose(float fhandle) = #49;
86 string fgets(float fhandle) = #50;
87 void fputs(float fhandle, string s) = #51;
89 float strlen(string s) = #52;
90 //string strcat(string s1,string s2,...) = #53;
91 string strcat(string s1, ...) = #53;
92 string substring(string s, float start, float length) = #54;
94 vector stov(string s) = #55;
96 string strzone(string s) = #56;
97 void strunzone(string s) = #57;
99 float tokenize(string s) = #58
100 string argv(float n) = #59;
102 float isserver(void) = #60;
103 float clientcount(void) = #61;
104 float clientstate(void) = #62;
105 void clientcommand(float client, string s) = #63;
106 void changelevel(string map) = #64;
107 void localsound(string sample) = #65;
108 vector getmousepos(void) = #66;
109 float gettime(void) = #67;
110 void loadfromdata(string data) = #68;
111 void loadfromfile(string file) = #69;
113 float mod(float val, float m) = #70;
115 float search_begin(string pattern, float caseinsensitive, float quiet) = #74;
116 void search_end(float handle) = #75;
117 float search_getsize(float handle) = #76;
118 string search_getfilename(float handle, float num) = #77;
120 string chr(float ascii) = #78;
122 float etof(entity ent) = #79;
123 entity ftoe(float num) = #80;
125 float validstring(string str) = #81;
127 float altstr_count(string str) = #82;
128 string altstr_prepare(string str) = #83;
129 string altstr_get(string str, float num) = #84;
130 string altstr_set(string str, float num, string set) = #85
132 /////////////////////////////////////////////////
134 /////////////////////////////////////////////////
135 void WriteByte(float data, float dest, float desto) = #401;
136 void WriteChar(float data, float dest, float desto) = #402;
137 void WriteShort(float data, float dest, float desto) = #403;
138 void WriteLong(float data, float dest, float desto) = #404;
139 void WriteAngle(float data, float dest, float desto) = #405;
140 void WriteCoord(float data, float dest, float desto) = #406;
141 void WriteString(string data, float dest, float desto)= #407;
142 void WriteEntity(entity data, float dest, float desto) = #408;
144 //////////////////////////////////////////////////
146 //////////////////////////////////////////////////
148 float iscachedpic(string name) = #451;
149 string precache_pic(string name) = #452;
150 void freepic(string name) = #453;
152 float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
154 float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
156 float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
158 float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
160 void drawsetcliparea(float x, float y, float width, float height) = #458;
162 void drawresetcliparea(void) = #459;
164 vector drawgetimagesize(string pic) = #460;
166 float cin_open(string file, string name) = #461;
167 void cin_close(string name) = #462;
168 void cin_setstate(string name, float type) = #463;
169 float cin_getstate(string name) = #464;
171 ////////////////////////////////////////////////
173 ////////////////////////////////////////////////
175 void setkeydest(float dest) = #601;
176 float getkeydest(void) = #602;
178 void setmousetarget(float trg) = #603;
179 float getmousetarget(void) = #604;
181 float isfunction(string function_name) = #607;
182 void callfunction(...) = #605;
183 void writetofile(float fhandle, entity ent) = #606;
184 vector getresolution(float number) = #608;
185 string keynumtostring(float keynum) = #609;
186 string findkeysforcommand(string command) = #610;
188 float gethostcachevalue(float type) = #611;
189 string gethostcachestring(float type, float hostnr) = #612;
191 void parseentitydata(entity ent, string data) = #613;
193 float stringtokeynum(string key) = #614;
195 void resethostcachemasks(void) = #615;
196 void sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
197 void sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
198 void resorthostcache(void) = #618;
199 void sethostcachesort(float fld, float descending) = #619;
200 void refreshhostcache(void) = #620;
201 float gethostcachenumber(float fld, float hostnr) = #621;