Raised This Month: $ Target: $400
 0% 

Bot in kz_dajrokan


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SlayeR
Member
Join Date: Jan 2009
Location: Poland
Old 06-06-2010 , 08:02   Bot in kz_dajrokan
Reply With Quote #1

Hi. I have a problem with bot in dajrokan plugin... He should disconnect when players = 2 but he won't... Help!

There are a parts of code about bot:

PHP Code:
public client_putinserver(id) {

    
climber_time[id]    = 0
    climber_status
[id]    = STATUS_NONE
    climber_no_block
[id]    = kz_no_block true false
    climber_rgb
[id]        = GLOW_DEF
    climber_hud
[id]        = 1
    climber_teleports
[id]    = 0
    climber_checkpoints
[id]    = 0
    climber_stuck
[id]    = STUCK_COUNT
    climber_scout
[id]    = -1
    climber_meter
[id]    = origo
    climber_render
[id]    = true
    climber_lock
[id]    = true
    climber_action
[id]    = false
    climber_autotp
[id]    = true    

    
if (kz_bot) {
        new 
players[32], inum
        get_players
(playersinum)

        if (
inum == 1)
            
mi_bot_connect()
    }

        return 
PLUGIN_CONTINUE
}

public 
client_disconnect(id) {

    if (
kz_bot)
        if (
get_playersnum(1) == 2)
            
mi_bot_disconnect()

        return 
PLUGIN_CONTINUE


PHP Code:
public mi_bot_connect() {

    if (!
bot_id) {
        
bot_id engfunc(EngFunc_CreateFakeClientBOT_NAME)
        new 
ptr[128]
        
dllfunc(DLLFunc_ClientConnectbot_idBOT_NAME"127.0.0.1"ptr)
        
dllfunc(DLLFunc_ClientPutInServerbot_id)
        
cs_set_user_team(bot_idCS_TEAM_CTCS_CT_URBAN)
        
dllfunc(DLLFunc_Spawnbot_id)
        
set_pev(bot_idpev_effects, (pev(bot_idpev_effects) | 128))
        
set_pev(bot_idpev_solid0)
        
bot_userid get_user_userid(bot_id)
        
set_user_origin(bot_idorigo)
    }

    return 
PLUGIN_CONTINUE
}

public 
mi_bot_disconnect() {

    if (
bot_id) {
        
bot_id 0
        server_cmd
("kick #%d"bot_userid)
    }

    return 
PLUGIN_CONTINUE

SlayeR 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 05:24.


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