Raised This Month: $ Target: $400
 0% 

Problem with BOT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
padilha007
Senior Member
Join Date: Jul 2008
Old 01-21-2009 , 11:11   Problem with BOT
Reply With Quote #1

i creat a bot to prevent round end, but dont work 100%

PHP Code:
    new g_oldbotname[32]
        
    static 
botname[32]
    
formatexbotname31"BOT")
    
// Skip Real Players
    
new id find_player("ia"botname)

    if( !
equali(botnameg_oldbotname) )
    {
        if( 
is_user_connected(g_oldbotidct) && is_user_bot(g_oldbotidct) )
        {
            
set_user_info(g_oldbotidct"name"botname)
            return;
        }
    }
    
    
g_oldbotidct id engfunc(EngFunc_CreateFakeClientbotname)
        
    
g_oldbotname botname
        
    
if( pev_validid ) )
    {
        
engfuncEngFunc_FreeEntPrivateDataid)
        
dllfuncMetaFunc_CallGameEntity"player"id)
        
set_user_infoid"rate""3500" )
        
set_user_infoid"cl_updaterate""25" )
        
set_user_infoid"cl_lw""1" )
        
set_user_infoid"cl_lc""1" )
        
set_user_infoid"cl_dlmax""128" )
        
set_user_infoid"cl_righthand""1" )
        
set_user_infoid"_vgui_menus""0" )
        
set_user_infoid"_ah""0" )
        
set_user_infoid"dm""0" )
        
set_user_infoid"tracker""0" )
        
set_user_infoid"friends""0" )
        
set_user_infoid"*bot""1" )
        
set_pevidpev_flagspevidpev_flags ) | FL_FAKECLIENT )
        
set_pevidpev_colormapid )
            
        new 
msg[128]
        
        
dllfuncDLLFunc_ClientConnectidbotname"127.0.0.1"msg )
        
dllfuncDLLFunc_ClientPutInServerid )
        
engfuncEngFunc_RunPlayerMoveidFloat:{0.0,0.0,0.0}, 0.00.00.00076 )
        
        
set_pev(idpev_takedamageDAMAGE_NO)
        
        
dllfunc(DLLFunc_Spawnid
Attached Thumbnails
Click image for larger version

Name:	imagem.JPG
Views:	309
Size:	71.4 KB
ID:	36131  
__________________


Last edited by padilha007; 01-21-2009 at 11:15.
padilha007 is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-21-2009 , 11:37   Re: Problem with BOT
Reply With Quote #2

I think that the is_user_bot() native is only for CZ bots.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 01-21-2009 at 11:44.
Dores is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 01-21-2009 , 11:45   Re: Problem with BOT
Reply With Quote #3

Quote:
2) I think that the is_user_bot() native is only for CZ bots.
Works for DoD.. so i thinks its... for bots
__________________
Dr.G is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-21-2009 , 13:39   Re: Problem with BOT
Reply With Quote #4

Quote:
Originally Posted by Dr.G View Post
Works for DoD.. so i thinks its... for bots
Yeah but not self made bots, but hardcoded game bots...
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-21-2009 , 14:29   Re: Problem with BOT
Reply With Quote #5

I think is_user_bot should work, but you have to update the bot each frame (FM_StartFrame), even if you don't plain to use this native.

PHP Code:
public StartFrame()
{
    if(
g_iBot && pev_valid(g_iBot))
    {
        static 
Float:fMSec
        set_pev
(g_iBotpev_flagspev(g_iBotpev_flags) | FL_FAKECLIENT)
        
global_get(glb_frametimefMSec)
        
fMSec *= 1000.0
        engfunc
(EngFunc_RunPlayerMoveg_iBotFloat:{0.0,0.0,0.0}, 0.00.00.000floatround(fMSec))
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-21-2009 , 14:46   Re: Problem with BOT
Reply With Quote #6

@padilha: Did you make it think often?
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 01-21-2009 , 11:46   Re: Problem with BOT
Reply With Quote #7

i need use my code
__________________


Last edited by padilha007; 01-27-2009 at 17:08.
padilha007 is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 01-21-2009 , 17:01   Re: Problem with BOT
Reply With Quote #8

no =z
__________________

padilha007 is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-22-2009 , 08:00   Re: Problem with BOT
Reply With Quote #9

Quote:
Originally Posted by padilha007 View Post
no =z
I'm not sure you must make it think, but do what Connor said(update it every frame).
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 01-22-2009 , 10:50   Re: Problem with BOT
Reply With Quote #10

@ConnorMcLeod
I just add this to work perfect:
PHP Code:
public StartFrame()
{
    if(
g_iBot && pev_valid(g_iBot) && is_user_connected(g_iBot) && is_user_alive(g_iBot))
    {
        static 
Float:fMSec
        set_pev
(g_iBotpev_flagspev(g_iBotpev_flags) | FL_FAKECLIENT)
        
global_get(glb_frametimefMSec)
        
fMSec *= 1000.0
        engfunc
(EngFunc_RunPlayerMoveg_iBotFloat:{0.0,0.0,0.0}, 0.00.00.000floatround(fMSec))
    }

__________________


Last edited by padilha007; 01-27-2009 at 17:10.
padilha007 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 01:48.


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