Raised This Month: $ Target: $400
 0% 

Crash when creating a bot


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

Did as you requested with the same code, but changed everything to log_amx()

PHP Code:
public BOTid )
{
    
g_iBotIndex engfuncEngFunc_CreateFakeClient"Test Bot" );

    if( !
g_iBotIndex )
        return 
PLUGIN_HANDLED;

    
log_amx"Bot created with ID %i"g_iBotIndex );

    
log_amx"FREE ENT PRIVATE DATA PRE" );

    
engfuncEngFunc_FreeEntPrivateDatag_iBotIndex );

    
log_amx"FREE ENT PRIVATE DATA POST" );

    static 
szBlock128 ];

    
log_amx"BOT CONNECT PRE" );

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

    
log_amx"BOT CONNECT POST" );

    if( !
is_user_connectedg_iBotIndex ) )
        return 
PLUGIN_HANDLED;

    
log_amx"BOT CONNECTED" );

    
log_amx"BOT PUTINSERVER PRE" );

    
dllfuncDLLFunc_ClientPutInServerg_iBotIndex );

    
log_amx"BOT PUTINSERVER POST" );

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

The log shows nothing.

Code:
L 06/22/2018 - 01:36:38: -------- Mapchange to bhm_novice --------
L 06/22/2018 - 01:38:05: -------- Mapchange to bhop_celsbrick --------
L 06/22/2018 - 01:52:26: -------- Mapchange to bhm_novice --------
L 06/22/2018 - 11:10:16: -------- Mapchange to bhop_celsbrick --------
The game freezes and than crashes is a better description. Also, this is the only plugin running.
__________________

Last edited by marcelowzd; 06-22-2018 at 10:14.
marcelowzd is offline
marcelowzd
Senior Member
Join Date: Feb 2011
Location: São Paulo, Brazil
Old 06-22-2018 , 13:11   Re: Crash when creating a bot
Reply With Quote #2

After doing a clean install for the second time it started working, but now when i spawn the bot he is invisible.

PHP Code:
public BOTid )
{
    
g_iBotIndex engfuncEngFunc_CreateFakeClient"Test Bot" );

    if( !
g_iBotIndex )
        return 
PLUGIN_HANDLED;

    
engfuncEngFunc_FreeEntPrivateDatag_iBotIndex );

    static 
szBlock128 ];

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

    if( !
is_user_connectedg_iBotIndex ) )
        return 
PLUGIN_HANDLED;

    
dllfuncDLLFunc_ClientPutInServerg_iBotIndex );

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

    
cs_set_user_teamg_iBotIndexCS_TEAM_CTCS_CT_GSG9 );

    
ExecuteHamBHam_CS_RoundRespawng_iBotIndex ); // Tried

    //dllfunc( DLLFunc_Spawn, g_iBotIndex );  // Tried

    
if( !is_user_aliveg_iBotIndex ) )
        return 
PLUGIN_HANDLED;

    
//set_user_rendering( g_iBotIndex, kRenderFxNone, 255, 255, 255, kRenderNormal, 25 ); // Tried

    
fm_set_renderingg_iBotIndexkRenderNormal255255255kRenderNormal25 ); // Tried

    //fm_set_user_rendering( g_iBotIndex, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 25 ); //Tried

    //set_pev( g_iBotIndex, pev_origin, fOrigin );

    
return PLUGIN_HANDLED;

I can see his name, health and he can block me, but he is completely invisible.
Neither option listed above worked.
__________________

Last edited by marcelowzd; 06-22-2018 at 18:14.
marcelowzd is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 06-22-2018 , 13:58   Re: Crash when creating a bot
Reply With Quote #3

Try running this line twice in a row:
ExecuteHamB( Ham_CS_RoundRespawn, g_iBotIndex ); // Tried

I can't remember what exactly, but there's some issues when executing it just once, this might be one of them.
Kushfield is offline
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 12:34.


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