Hello,
I hope i got the right Categorie for it...
Made my first Plugin, it's simple but not rly good coded.
I only need it to get more IQ about AMXX
My Problem:
If i'm starting the Server with this Plugin the Server crash.
If i'm starting the Server wirhout the Plugin and put it after into the list and restarting the map, the Plugin works correctly!
BUT after one more mapchange or map restart the Server crash...
I only could get the following Errors at the Console:
SZ_GetSpace: overflow without FSB_ALLOWOVERLOW set on Server Reliable Datagram
and this one until i'm starting the server with the plugin:
Segmentation fault (core dumped) $HL_CMD
I also asking <[RNT]ZODIAC> and show him my Plugin, but he also has no Idea and so i#m asking now here...
THE CODE (I'm using the newest AMXX Version for the Server)
Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#define PLUGIN "Sabith P.F."
#define VERSION "1.0"
#define AUTHOR "xcoder"
new botteam[3]
static const botnames[3][] = {
"NULL",
"Botname 1",
"Botname 2"
}
public plugin_init()
{
register_plugin("Sabith P.F.", "1.0", "xcoder")
// joine bots to spectate
createBots(3)
}
public plugin_end()
{
dropBots(3)
}
createBots(anzahl)
{
new bot, x
for(x = 1; x<anzahl; x++)
{
//is bot in server already?
bot = find_player("bli", botnames[x] )
if(bot) {
botteam[x] = bot
continue
}
//bot not in server, create them.
bot = engfunc(EngFunc_CreateFakeClient, botnames[x])
botteam[x] = bot
new ptr[128]
dllfunc(DLLFunc_ClientConnect, bot, botnames[x], "127.0.0.1", ptr )
dllfunc(DLLFunc_ClientPutInServer, bot)
}
}
dropBots(anzahl)
{
new bot, x
for(x = 1; x<anzahl; x++)
{
//is bot in server already?
bot = find_player("bli", botnames[x] )
if(bot) {
// found bot, remove him
new Players[32]
new playerCount, i, player
get_players(Players, playerCount, "f", botnames[x])
for (i=0; i<playerCount; i++)
{
player = Players[i]
new userid = get_user_userid(player)
server_cmd("kick #%d Botkick",userid)
}
continue
}
// no bot found...
}
}
Hope someone knows whats wrong...
Sorry for my broken english!