Raised This Month: $ Target: $400
 0% 

Fakebot Handling (Crash on start/mapchange/restart)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XCoder
Member
Join Date: Mar 2006
Location: Worldwide
Old 12-16-2008 , 12:20   Fakebot Handling (Crash on start/mapchange/restart)
Reply With Quote #1

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!
XCoder is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-16-2008 , 12:27   Re: Fakebot Handling (Crash on start/mapchange/restart)
Reply With Quote #2

Scripting Questions/Help belongs in Scripting Help. Moved
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
XCoder
Member
Join Date: Mar 2006
Location: Worldwide
Old 12-16-2008 , 12:35   Re: Fakebot Handling (Crash on start/mapchange/restart)
Reply With Quote #3

Thanks for moving
XCoder is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 12-16-2008 , 13:50   Re: Fakebot Handling (Crash on start/mapchange/restart)
Reply With Quote #4

One, check if their valid entites before removing. Second, look at FakeFull, I think there was something in there that prevented crashes. Also, I don't recommend adding 3 entities all at once on plugin_init().
Styles is offline
Send a message via AIM to Styles
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode