Raised This Month: $ Target: $400
 0% 

respawn for bots


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-13-2012 , 14:04   respawn for bots
Reply With Quote #1

I made this, it works perfect on real players but bots don't respawn,
why? how can i add bots to respawn to?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "T-AutoSpawn"
#define VERSION "1.0"
#define AUTHOR "Sky-High"
new Pcvar_RespawnTime;
public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_Killed"player""Fwd_PlayerKilled");
 
 
Pcvar_RespawnTime register_cvar"osg_respawn_time""5.0" );
}
 
public 
Fwd_PlayerKilled(victimattackershouldgib)
{
 new 
FloatTime;
 static 
CsTeams:team;
 
team cs_get_user_team(victim);
 
Time get_pcvar_floatPcvar_RespawnTime );
 
 if (
team == CS_TEAM_T)
 {
  
set_taskTime"Task_Respawn"victim);
 }
}
 
public 
Task_Respawn(id)
{
 
ExecuteHamB(Ham_CS_RoundRespawnid);

__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-13-2012 , 14:44   Re: respawn for bots
Reply With Quote #2

If you are using cz bots, install this : http://forums.alliedmods.net/showthr...83#post1715483

And add in your plugin :

PHP Code:
public cz_bot_ham_registerableid )
{
  
RegisterHamFromEntity(Ham_Killedid"Fwd_PlayerKilled")

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-13-2012 , 18:38   Re: respawn for bots
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
If you are using cz bots, install this : http://forums.alliedmods.net/showthr...83#post1715483
[/php]
Install on my server you mean or make an include of it?
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-14-2012 , 16:02   Re: respawn for bots
Reply With Quote #4

Ok, I compiled that plugin and installed it on my server, then i added the public to my plugin an compiled but bots still don't respawn.

should i merge the 2 plugins into 1? (my t autospawn and your plugin?

Edit: I did that too and still the bots don't get respawned its werid there are maps where they do respawn and on other maps they don't
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 07-14-2012 at 20:06.
striker07 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-15-2012 , 07:26   Re: respawn for bots
Reply With Quote #5

Gonna try, may be IsBot doesn't return what it should.

You don't need to merge anything, the other plugin is made so you can use the forward in any plugin.


Edit :

Following code is working on windows, tell me if it works on linux.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "2.1.2"

new g_iFwdSetClientKeyValue

public plugin_init()
{
    
register_plugin("Ham Register Cz Bots"VERSION"ConnorMcLeod")
}

public 
client_putinserverid )
{
    if( 
is_user_bot(id) )
    {
        if( !
g_iFwdSetClientKeyValue )
        {
            
g_iFwdSetClientKeyValue register_forward(FM_SetClientKeyValue"SetClientKeyValue")
        }
    }
}

public 
SetClientKeyValue(idinfobuffer[], key[], value[])
{
    if( 
value[0] == '1' && equal(key"*bot") )
    {
        
unregister_forward(FM_SetClientKeyValueg_iFwdSetClientKeyValue)
        if( 
IsCzBotid ) )
        {
            new 
iForward CreateMultiForward("cz_bot_ham_registerable"ET_IGNOREFP_CELL)
            new 
iRet
            ExecuteForward
(iForwardiRetid)
            
DestroyForward(iForward)
            
pause("ac")
        }
    }
}

IsCzBotid )
{
#if defined Ham_CS_Player_IsBot
    
static valid = -1
    
if( valid == -)
    {
        
valid IsHamValidHam_CS_Player_IsBot )
    }
    if( 
valid )
    {
        return 
ExecuteHam(Ham_CS_Player_IsBotid)
    }
    return 
ExecuteHam(Ham_Weapon_ExtractClipAmmoid0)
#else
    
return ExecuteHam(Ham_Weapon_ExtractClipAmmoid0)
#endif

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-24-2012 at 06:15.
ConnorMcLeod is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-15-2012 , 12:19   Re: respawn for bots
Reply With Quote #6

aaah nice,
thank you very much connor this one works for me

so what exactly does this plugin do?
does it make sure that any type of bots are registered too in all events like a real player?
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 07-15-2012 at 13:32.
striker07 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-16-2012 , 17:51   Re: respawn for bots
Reply With Quote #7

Hey connor I have another issue that i cant seem to fix, wich i am sure of u can

ok so all my terrorist players are bots, (+-14 bots) and when the round ends all ters die due to the plugin force_round_end (its a plugin i can't miss so i can't just delete it). so when all terrorists die a task is set in my plugin to respawn them and there is the problem when the round ended the bots will automaticly spawn and therefore don't need to respawn again so i tryed to remove the task but without succes.

Now my server crashes everytime all terrorists die.

this is what I have done but it doesnt work, could you take a look at it pls?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta> 
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "T-AutoSpawn"
#define VERSION "1.0"
#define AUTHOR "Sky-High"
#define TASK_REVIVE 1000
new Pcvar_RespawnTime;
public 
plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
//RegisterHam(Ham_Killed, "player", "Fwd_PlayerKilled");
 
 
Pcvar_RespawnTime register_cvar"osg_respawn_time""5.0" );
 
 
register_logevent("EventRoundEnd"2"1&Restart_Round");
 
register_logevent("EventRoundEnd"2"1=Game_Commencing");
 
register_logevent("EventRoundEnd"2"1=Round_End");
}
public 
cz_bot_ham_registerableid 

 
RegisterHamFromEntity(Ham_Killedid"Fwd_PlayerKilled"

public 
EventRoundEnd()
{
 static 
iPlayers[32], iNumidiPlayer;
 
get_playersiPlayersiNum"e""T" ); 
 for ( 
id=0id<iNumid++ )
 {
  
iPlayer iPlayers[id];
  
remove_task(TASK_REVIVE+iPlayer)
 }
}
public 
client_authorized (id)
{
 
set_task(4.5"Ad"id);
 
set_task400.0"Ad"id__"b" );
}
public 
Fwd_PlayerKilled(victimattackershouldgib)
{
 new 
FloatTime;
 static 
CsTeams:team;
 
team cs_get_user_team(victim);
 
Time get_pcvar_floatPcvar_RespawnTime );
 
 if (
team == CS_TEAM_T)
 {
  
set_taskTime"Task_Respawn"TASK_REVIVE+victim);
 }
}
 
public 
Task_Respawn(id)
{
 
ExecuteHamB(Ham_CS_RoundRespawnid);

Code:

L 07/17/2012 - 00:273: [HAMSANDWICH] Entity has null private data (1005)
L 07/17/2012 - 00:273: [AMXX] Run time error 10 (plugin "t_autospawn.amxx") (native "ExecuteHamB") - debug not enabled!
L 07/17/2012 - 00:273: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 07/17/2012 - 001:05: FATAL ERROR (shutting down): SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Datagram
FATAL ERROR (shutting down): SZ_GetSpace: overflow without FSB_ALLOWOVERFLOW set on Server Datagram
Add "-debug" to the ./hlds_run command line to generate a debug.log to help with solving this problem
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 07-17-2012 at 08:02.
striker07 is offline
Old 07-16-2012, 18:09
striker07
This message has been deleted by striker07.
CS-A-Roland
Member
Join Date: Jul 2009
Old 07-17-2012 , 09:38   Re: respawn for bots
Reply With Quote #8

Hey striker, ive an idea for you!
The Bots spawn on the CSDM perfect so visit there the csdm_spawn_preset.sma and the spawn_editor.sma
If you catch the funktions i think you can make it like CSDM and write coordinates for every map to spawn the players/bots...

But if it needed dont forget to add the module of csdm...
You know ive not the knowledge, but there i think you can find some parts wich could help you out...
__________________
oOOOoooh it's www.Cs-Attack.de
New World of Warcraft Mod Beta 0.5(based on WC3FT 3.5)
Counterstrike 1.6 SERVER:
Server IP: 193.192.58.154:27200

CONDITION ZERO SERVER:
Server IP: 193.192.58.154:27016
CS-A-Roland is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 07-17-2012 , 10:44   Re: respawn for bots
Reply With Quote #9

yes that maybe true but i already have everything i need (spawns, waypoints etc) I don't want to add a new csdm plugin replacing mine, you have a point on openeing the .sma's but my respawn plugin was working perfectly before, so when i updated it with the remove task then the problems came, the bots didnt even respawn so it's got to be with the id of the task and i don't know what i did wrong, i've been searching through many plugins but i can't find any problem i coded the tasks like they should and still they fail to work :s
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-24-2012 , 06:15   Re: respawn for bots
Reply With Quote #10

I have edited the code a bit but i don't think it was bad.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 15:19.


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