my plugin crushes server, why ?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
//Set botname here.
#define BOTNAME "botname here"
public plugin_init()
{
register_plugin("FakePlayer", "1.0", "xPaw")
createBot()
}
public createBot()
{
new bot;
//is bot in server already?
bot = find_player("bi", BOTNAME)
if(bot) {
return PLUGIN_HANDLED
}
//bot not in server, create them.
bot = engfunc(EngFunc_CreateFakeClient, BOTNAME)
new ptr[128];
dllfunc(DLLFunc_ClientConnect, bot, BOTNAME, "127.0.0.1", ptr)
dllfunc(DLLFunc_ClientPutInServer, bot)
cs_set_user_team(bot, CS_TEAM_SPECTATOR, CS_DONTCHANGE)
return PLUGIN_CONTINUE
}