Well like I mentioned to KWo the bot needed reinitialising:
Code:
static cell AMX_NATIVE_CALL create_bot(AMX *amx, cell *params) {
int iLen;
char* botname = GET_AMXSTRING(amx, params[1], 0, iLen);
edict_t* pEdict = CREATE_FAKE_CLIENT(botname);
if(!pEdict) {
AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
return 0;
}
pEdict->v.flags |= FL_FAKECLIENT;
CPlayer *pPlayer = GET_PLAYER_POINTER(pEdict);
pPlayer->id = ENTINDEX(pEdict);
pPlayer->pEdict = pEdict;
CALL_GAME_ENTITY(PLID, "player", VARS(pPlayer->pEdict));
char *sInfoBuffer = GET_INFOKEYBUFFER(pPlayer->pEdict);
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "rate", "3500");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_updaterate", "20");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_lw", "1");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_lc", "1");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "cl_dlmax", "128");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "_vgui_menus", "0");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "_ah", "0");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "dm", "0");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "tracker", "0");
SET_CLIENT_KEYVALUE(pPlayer->id, sInfoBuffer, "friends", "0");
char szRejectReason[128];
MDLL_ClientConnect(pPlayer->pEdict, botname, "127.0.0.1", szRejectReason);
MDLL_ClientPutInServer(pPlayer->pEdict);
RUNPLAYERMOVE(pPlayer->pEdict, pPlayer->pEdict->v.v_angle, 0.0, 0.0, 0, 0, 0, 76);
return 1;
}
Don't think there is any problems with the above? Only occurs whilst using the damage natives I created ie outside influence.
-Targ