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

[REQ] Removes bot when players in server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BadAim
Senior Member
Join Date: Feb 2006
Location: canada
Old 02-01-2008 , 20:07   [REQ] Removes bot when players in server
Reply With Quote #1

I would like to removes the bots when more than 6 players is in the server, and they comes back when the minimum player number is reached. This is the original code, i didnt modify it. i offer 5$ and karma for this small code lolz.

Thanks in advance

Code:
// Never do you have to deal with round ending again!
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

new botteam[3]

static const botnames[3][] = {
	"NULL", 
	"Terrorist Team", 			//Change Terrorist Bot Name
	"Counter-Terrorist Team"	//Change CT Bot name
	}

public plugin_init() 
{
	register_plugin("Fake TeamBot", "1.0", "OneEyed")
	register_event("HLTV","StartRound","a","1=0","2=0")
	createBots()
}

public StartRound()
	set_task(0.5, "PostStartRound", 0)

public PostStartRound()
	for(new x=1; x<3; x++) {
		set_pev(botteam[x], pev_effects, (pev(botteam[x], pev_effects) | 128) ) //set invisible
		set_pev(botteam[x], pev_solid, 0) 		//Not Solid
		set_pev(botteam[x], pev_takedamage, DAMAGE_NO) //No dmg
	}

createBots()
{
	new bot, x
	for(x = 1; x<3; x++) 
	{
		//is bot in server already?
		bot = find_player("bli", botnames[x] )
		if(bot) {
			botteam[x] = bot
			continue
		}
		
		//bot not in server, create them.
		bot = engfunc(EngFunc_CreateFakeClient, botnames[x])
		botteam[x] = bot
		new ptr[128]
		dllfunc(DLLFunc_ClientConnect, bot, botnames[x], "127.0.0.1", ptr )
		dllfunc(DLLFunc_ClientPutInServer, bot)
		select_model(bot, x)
	}
}

select_model(id,team)
	switch(team) {
		case 1: cs_set_user_team(id, CS_TEAM_T, CS_T_TERROR)
		case 2: cs_set_user_team(id, CS_TEAM_CT, CS_CT_URBAN)
	}

Last edited by BadAim; 02-01-2008 at 20:13.
BadAim is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2008 , 20:38   Re: [REQ] Removes bot when players in server
Reply With Quote #2

EDIT: moved to PM
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 02-02-2008 at 12:21.
Exolent[jNr] is offline
BadAim
Senior Member
Join Date: Feb 2006
Location: canada
Old 02-01-2008 , 23:16   Re: [REQ] Removes bot when players in server
Reply With Quote #3

i dont know if my compiler works correctly but i have 2 errors. can you compile it and see if it does the same thing.

/home/groups/amxmodx/tmp3/phpqmsWMh.sma(60) : error 017: undefined symbol "botsExists"
/home/groups/amxmodx/tmp3/phpqmsWMh.sma(81) : error 017: undefined symbol "botsExists"
/home/groups/amxmodx/tmp3/phpqmsWMh.sma(81) : warning 215: expression has no effect

2 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpqmsWMh.amx (compile failed).
BadAim is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-01-2008 , 23:26   Re: [REQ] Removes bot when players in server
Reply With Quote #4

sry overlooked >.<

fixed now
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
BadAim
Senior Member
Join Date: Feb 2006
Location: canada
Old 02-02-2008 , 09:51   Re: [REQ] Removes bot when players in server
Reply With Quote #5

my server crash when the 6th player join the server
BadAim 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 05:16.


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