+//entity() spawnclient (DP_SV_BOTCLIENT)
+void PF_spawnclient (void)
+{
+ int i;
+ edict_t *ed;
+ pr_xfunction->builtinsprofile += 2;
+ ed = sv.edicts;
+ for (i = 0;i < svs.maxclients;i++)
+ {
+ if (!svs.clients[i].active)
+ {
+ pr_xfunction->builtinsprofile += 100;
+ SV_ConnectClient (i, NULL);
+ ed = EDICT_NUM(i + 1);
+ break;
+ }
+ }
+ RETURN_EDICT(ed);
+}
+
+//float(entity clent) clienttype (DP_SV_BOTCLIENT)
+void PF_clienttype (void)
+{
+ int clientnum;
+ clientnum = G_EDICTNUM(OFS_PARM0) - 1;
+ if (clientnum < 0 || clientnum >= svs.maxclients)
+ G_FLOAT(OFS_RETURN) = 3;
+ else if (!svs.clients[clientnum].active)
+ G_FLOAT(OFS_RETURN) = 0;
+ else if (svs.clients[clientnum].netconnection)
+ G_FLOAT(OFS_RETURN) = 1;
+ else
+ G_FLOAT(OFS_RETURN) = 2;
+}