Raised This Month: $ Target: $400
 0% 

Help on plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-30-2007 , 18:20   Help on plugin
Reply With Quote #1

im trying to make a plugin that on CS:CZ it adds bots when there are 0 players and takes them away when players enter

would this work

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
new p_botnumber
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
p_botnumber register_cvar"amx_botnubmer""6" );
 
}
public 
check_playernumber()
{
 if(!
get_playersnum 0)
  
server_cmd("bot_quota %s"p_botnumber)
{
 else
 {
  if(!
get_playersnum()==0)
   
server_cmd("bot_quota 0")
  } 
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-30-2007 , 18:22   Re: Help on plugin
Reply With Quote #2

No, that won't work. Mainly because where are you calling check_playernumber?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-30-2007 , 18:25   Re: Help on plugin
Reply With Quote #3

i dont know lol i was just messing with some code, i was just trying to make this, im still not all that good at scripting

Can you help me?
__________________


Last edited by Reaper2331; 09-30-2007 at 19:14.
Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-30-2007 , 20:49   Re: Help on plugin
Reply With Quote #4

Try this :
Code:
#include <amxmodx> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" new cvar_max_bots, cvar_bot_quota public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     cvar_max_bots = register_cvar("amx_botnubmer", "6")     cvar_bot_quota = get_cvar_pointer("bot_quota") } public client_connect(id)     if(!is_user_bot(id))         check_playernumber() public client_disconnect(id)     if(!is_user_bot(id))         check_playernumber() check_playernumber() {     new players[32], inum, maxbots = get_pcvar_num(cvar_max_bots)     get_players(players, inum, "c")     if( inum < maxbots )         set_pcvar_num(cvar_bot_quota, maxbots - inum)     else         set_pcvar_num(cvar_bot_quota, 0) }

Last edited by ConnorMcLeod; 10-01-2007 at 22:39.
ConnorMcLeod is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 09-30-2007 , 21:02   Re: Help on plugin
Reply With Quote #5

thx but this only adds the bots it never removes them, i want something like when a player enters a bot leaves when 6 players enter 6 bots leave
__________________


Last edited by Reaper2331; 09-30-2007 at 21:15.
Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
potatis_invalido
BANNED
Join Date: Jul 2007
Location: 0 (world)
Old 10-01-2007 , 05:25   Re: Help on plugin
Reply With Quote #6

replace
set_pcvar_num(cvar_bot_quota, 0)
with
server_cmd("bot_kick")
potatis_invalido is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 10-01-2007 , 20:00   Re: Help on plugin
Reply With Quote #7

not working still

i want it to Kick 1 bot when 1 player enters
2 bots when 2 players in server
3 bots when 3 players in server
and etc
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-01-2007 , 22:40   Re: Help on plugin
Reply With Quote #8

I've just edited the code, try it again
ConnorMcLeod is offline
Reaper2331
Veteran Member
Join Date: Nov 2006
Location: Columbus,Ohio
Old 10-01-2007 , 22:50   Re: Help on plugin
Reply With Quote #9

/home/groups/amxmodx/tmp3/phpiH86DV.sma(10) : error 037: invalid string (possibly non-terminated string)

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpiH86DV.amx (compile failed).
__________________

Reaper2331 is offline
Send a message via AIM to Reaper2331 Send a message via MSN to Reaper2331 Send a message via Yahoo to Reaper2331
Old 10-01-2007, 22:55
X-Script
This message has been deleted by X-Script. Reason: er
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-01-2007 , 23:08   Re: Help on plugin
Reply With Quote #10

I've only renamed pointer 'max' to 'maxbots' so it should compiles fine, just don't know why you fail.
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 16:09.


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