Here's my code:
//-----------------------------------------------------------------------
edict_t *bot;
int modelIndex;
char c_skin[32];
char c_name[32] = "Player";
char c_index[3];
char *infobuffer;
modelIndex = RANDOM_LONG(0,3); // Assign a random model
char dir_name[32];
char filename[128];
char ptr[128];
sprintf(ptr, "Creating bot \"%s\" using model %s with skill=%d\n", c_name, modelIndex);
GET_GAME_DIR(dir_name);
sprintf(filename, "%s\\models\\player\\%s", dir_name, c_skin);
bot = CREATE_FAKE_CLIENT(c_name); // Create the player entity
infobuffer = GET_INFOBUFFER( bot );
SET_CLIENT_KEY_VALUE( 1, infobuffer, "model", c_skin );
SET_CLIENT_KEY_VALUE( 1, infobuffer, "index", c_index );
MDLL_ClientConnect (bot, c_name, "127.0.0.1", ptr);
MDLL_ClientPutInServer (bot);
//-----------------------------------------------------------------------
What am I doing wrong ?
when I try it it crashes...!
How can I create a player entity in COunter-Strike ?
what functions do you use ?