Raised This Month: $ Target: $400
 0% 

Crash when creating a bot


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 06-22-2018 , 00:49   Crash when creating a bot
Reply With Quote #1

Hello, i was trying to create a simple BOT with the following code.

PHP Code:
new g_iBotIndex;

public 
plugin_init( )
{
    
register_clcmd"CreateBot""BOT" );
}

public 
BOTid )
{
    
g_iBotIndex engfuncEngFunc_CreateFakeClient"Test Bot" );

    if( !
g_iBotIndex )
        return 
PLUGIN_HANDLED;

    
console_printid"Bot criado com id %i"g_iBotIndex );

    
engfuncEngFunc_FreeEntPrivateDatag_iBotIndex );

    static 
szBlock128 ];

    
//console_print( id, "Tentativa de conectar PRE" );

    
dllfuncDLLFunc_ClientConnectg_iBotIndex"[SV] Pro 1 BOT""127.0.0.1"szBlock );

    
console_printid"Tentativa de conectar POST" );

    if( !
is_user_connectedg_iBotIndex ) )
        return 
PLUGIN_HANDLED;

    
console_printid"Bot conectado" );

    
dllfuncDLLFunc_ClientPutInServerg_iBotIndex );

    
console_printid"Bot entrou no server" );

    
set_pevg_iBotIndexpev_spawnflagspevg_iBotIndexpev_spawnflags ) | FL_FAKECLIENT ); 
    
set_pevg_iBotIndexpev_flagspevg_iBotIndex,pev_flags ) | FL_FAKECLIENT );

    return 
PLUGIN_HANDLED;

Sometimes it works and sometimes it just crashes my CS. As you can see i already used some debug messages, but when the game crashes, it doesn't show anything at all. What could be the problem?

Some more info: Using AMXX 1.8.3 +dev5154, Metamod-P v1.21p37.
__________________

Last edited by marcelowzd; 06-22-2018 at 00:51.
marcelowzd is offline
 



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 12:34.


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