Raised This Month: $ Target: $400
 0% 

[REQ] Bot in Spectators with special options


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rastafari
Senior Member
Join Date: May 2011
Old 07-26-2011 , 12:28   [REQ] Bot in Spectators with special options
Reply With Quote #1

Well, I'm requesting a plugin which create a bot in spectator menu and have a special use, like showing, next map in name or timeleft or maybe both.
I had this idea, because I have the timeleft in my server's name so and it's name would be ~50 characters long with showing the nextmap.
So, the plugin would create a bot (little help for it from OneEyed ) with showing the nextmap in its name, like this:

and also xPaw's plugin could help: Timeleft in Hostname
I would be very happy and gladful is someone could make this (I think GREAT) plugin, I think it's not that difficult but I don't know coding.
Attached Thumbnails
Click image for larger version

Name:	2011-07-26_00001.jpg
Views:	2120
Size:	26.8 KB
ID:	89484  
rastafari is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-26-2011 , 13:47   Re: [REQ] Bot in Spectators with special options
Reply With Quote #2

Great idea, will try todo this.

EDIT: This worked for me, the bot refreshes it's name all ten seconds.

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

new amx_nextmap

public plugin_init()
{
    
register_plugin("Nextmap BOT""1.0""AMXX Community")
    
    
amx_nextmap get_cvar_pointer("amx_nextmap")

    
set_task(5.0"create_bot")
}

public 
create_bot()
{
    new 
nextmap[64]
    
get_pcvar_string(amx_nextmapnextmapsizeof(nextmap) - 1)
    
    new 
buffer[75]
    
formatex(buffersizeof(buffer) - 1"Nextmap: %s"nextmap)
    
    new 
bot
    bot 
engfunc(EngFunc_CreateFakeClientbuffer)
    
    new 
ptr[128]
    
dllfunc(DLLFunc_ClientConnectbotnextmap"127.0.0.1"ptr)
    
dllfunc(DLLFunc_ClientPutInServerbot)
    
    
set_user_info(bot"rate""3500")
    
set_user_info(bot"cl_updaterate""25")
    
set_user_info(bot"cl_lw""1")
    
set_user_info(bot"cl_lc""1")
    
set_user_info(bot"cl_dlmax""128")
    
set_user_info(bot"cl_righthand""1")
    
set_user_info(bot"_vgui_menus""0")
    
set_user_info(bot"_ah""0")
    
set_user_info(bot"dm""0")
    
set_user_info(bot"tracker""0")
    
set_user_info(bot"friends""0")
    
set_user_info(bot"*bot""1")
    
    
cs_set_user_team(botCS_TEAM_SPECTATORCS_DONTCHANGE)
    
    
set_task(10.0"update_bot_name"bot)
}

public 
update_bot_name(bot)
{
    if(
is_user_connected(bot))
    {
        new 
nextmap[64]
        
get_pcvar_string(amx_nextmapnextmapsizeof(nextmap) - 1)
    
        new 
buffer[75]
        
formatex(buffersizeof(buffer) - 1"Nextmap: %s"nextmap)
    
        
set_user_info(bot"name"buffer)
    
        
set_task(10.0"update_bot_name"bot)
    }

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.

Last edited by bibu; 07-27-2011 at 13:51. Reason: Added a newer version.
bibu is offline
rastafari
Senior Member
Join Date: May 2011
Old 07-27-2011 , 00:17   Re: [REQ] Bot in Spectators with special options
Reply With Quote #3

Man, you are simply awsome
You should post this to the new plugins area, to let other ppl know how cool you are.
rastafari is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 07-27-2011 , 07:25   Re: [REQ] Bot in Spectators with special options
Reply With Quote #4

Does it occupy a slot?

Code:
	new bot
	bot = engfunc(EngFunc_CreateFakeClient, nextmap)

Code:
	new buffer[64];
	format(buffer, 63, "Nextmap: %s", nextmap)
	
	new bot
	bot = engfunc(EngFunc_CreateFakeClient, buffer)
Attached Thumbnails
Click image for larger version

Name:	Image 014.jpg
Views:	567
Size:	26.0 KB
ID:	89546  

Last edited by GarbageBox; 07-27-2011 at 10:53.
GarbageBox is offline
rastafari
Senior Member
Join Date: May 2011
Old 07-27-2011 , 08:10   Re: [REQ] Bot in Spectators with special options
Reply With Quote #5

Yes it is, tested like 10 hours, perfectly working, and all the players like it, half of them wondered: wtf??O.o
So in my opinion, this is amazing.
rastafari is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-27-2011 , 13:50   Re: [REQ] Bot in Spectators with special options
Reply With Quote #6

Thanks Garbage, completely forgot about formatting it.

I'm glad you like it.
Now it works how you wanted: "Nextmap: MAP". In the next days, I will optimize it abit, removing the task, and it would refresh the name exactly when the nextmap gets changed. Will post it as soon as I can fix it. Edited my post.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Shadymn
Senior Member
Join Date: Sep 2010
Old 06-25-2013 , 10:05   Re: [REQ] Bot in Spectators with special options
Reply With Quote #7

Need this cvar, if XX player connected to server bot will disappear and if players leave and doesn't reach XX BOT will join again?
Shadymn is offline
AMeEeRo
BANNED
Join Date: Dec 2013
Location: Who care ?
Old 04-30-2014 , 08:45   Re: [REQ] Bot in Spectators with special options
Reply With Quote #8

Quote:
Originally Posted by bibu View Post
Thanks Garbage, completely forgot about formatting it.

I'm glad you like it.
Now it works how you wanted: "Nextmap: MAP". In the next days, I will optimize it abit, removing the task, and it would refresh the name exactly when the nextmap gets changed. Will post it as soon as I can fix it. Edited my post.
Years to do it, it's nice when you can make it please
AMeEeRo 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 19:58.


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