Raised This Month: $51 Target: $400
 12% 

Solved Add bots to this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Naeciof
Member
Join Date: Oct 2016
Location: Brazil
Old 01-16-2024 , 01:08   Add bots to this plugin
Reply With Quote #1

Hello guys! I would like to add bots to this plugin

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new pRespawnEnabledbool:FirstSpawn[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""PostPlayerKilled"1)
    
    
pRespawnEnabled register_cvar("amx_respawn","1")
    
    
register_event("TeamInfo" "TeamInfo" "a")
    
    
server_cmd("mp_buytime 0")
}

public 
client_connect(id) {
    
FirstSpawn[id] = true
}

public 
PostPlayerKilled(iVictimiAttackershouldgib) {
    if(
get_pcvar_num(pRespawnEnabled)) {
        
set_task(2.0"RespawnVictim"iVictim)
    }
}

public 
RespawnVictim(id) {
    if(
get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {
        
ExecuteHamB(Ham_CS_RoundRespawnid
    }
}

public 
TeamInfo()
{
    new 
id szTeam];
    
    
id read_data)
    
read_dataszTeam charsmaxszTeam ) )
    
    switch( 
szTeam] )
    {
        case 
'T'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        case 
'C'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        
    }

Instant respawn plugin, but doesn't work with bots.

Last edited by Naeciof; 02-01-2024 at 23:21.
Naeciof is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 01-29-2024 , 11:57   Re: Add bots to this plugin
Reply With Quote #3

You will need to have https://forums.alliedmods.net/attach...0&d=1450810157 plugin running on your server and https://forums.alliedmods.net/attach...1&d=1450810157 include file to compile the plugin.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#include <cs_ham_bots_api>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new pRespawnEnabledbool:FirstSpawn[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""PostPlayerKilled"1)
    
#if defined _cs_ham_bots_api_included
    
RegisterHamBots(Ham_Killed"PostPlayerKilled"1)
    
#endif
    
    
pRespawnEnabled register_cvar("amx_respawn","1")
    
    
register_event("TeamInfo" "TeamInfo" "a")
    
    
server_cmd("mp_buytime 0")
}

public 
client_connect(id) {
    
FirstSpawn[id] = true
}

public 
PostPlayerKilled(iVictimiAttackershouldgib) {
    if(
get_pcvar_num(pRespawnEnabled)) {
        
set_task(2.0"RespawnVictim"iVictim)
    }
}

public 
RespawnVictim(id) {
    if(
get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {
        
ExecuteHamB(Ham_CS_RoundRespawnid
    }
}

public 
TeamInfo()
{
    new 
id szTeam];
    
    
id read_data)
    
read_dataszTeam charsmaxszTeam ) )
    
    switch( 
szTeam] )
    {
        case 
'T'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        case 
'C'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        
    }

__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Naeciof
Member
Join Date: Oct 2016
Location: Brazil
Old 02-01-2024 , 23:22   Re: Add bots to this plugin
Reply With Quote #4

Thanks!
Naeciof 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 06:38.


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