Raised This Month: $ Target: $400
 0% 

[help] motd and client_cmd


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Dr.G
Senior Member
Join Date: Nov 2008
Old 12-31-2008 , 07:29   Re: [help] motd and client_cmd
Reply With Quote #3

Thanks alot Hawk! I hope ive done it as it should be now Now it goes like this but still no cigar :/ Any ideas why the motd and cmds arent showen/used?

PHP Code:
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
// This will help your visitors to set there rates right
// All users can say /rates or !rates in chat and they will get a help screen
// with more info.
// Both txt files goes to the server root, where ie. server.cfg is found
//
//////////////////////////////////////////////////////////////////////////////////
//
// Thanks to: 
// Vet for show motd metode and txt file both taken from
// http://forums.alliedmods.net/showthread.php?p=541168
//
// BIG thanks to Hawk552 @ allied modders!
//
//////////////////////////////////////////////////////////////////////////////////
//
// Changelog:
// 12/30 08 - Code clean up! Thanks to Hawk552
//
//////////////////////////////////////////////////////////////////////////////////
#include <amxmodx>
#include <amxmisc>
#include <dodx>
#define PLUGIN "DoD Rate fixer"
#define AUTHOR "Dr.G - www.clan-go.net"
#define VERSION "1.1"
//NEW RATES Fit on most clients
#define RATE1 "cl_cmdrate 80"
#define RATE2 "cl_updaterate 80"
#define RATE3 "net_graph 3"
#define RATE4 "net_graphwidth 150"
#define RATE5 "cl_rate 9999"
#define RATE6 "rate 20000"
//DEFAULT RATES Taken from config.cfg
#define D_RATE1 "cl_cmdrate 30"
#define D_RATE2 "cl_updaterate 20"
#define D_RATE3 "net_graph 0"
#define D_RATE4 "net_graphwidth 0"
#define D_RATE5 "cl_rate 0"
#define D_RATE6 "rate 20000"
//FILES
#define HELP "rate_help.txt"
#define HELPURL "rate_tut.txt"
//pointers
new p_enablep_timeacmsgp_joinmsgp_cycleinfop_infotime
public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
register_cvar("dod_rate_fixer_stats"VERSIONFCVAR_SERVER|FCVAR_SPONLY)
 
register_clcmd("say","sayEvent")
 
register_clcmd("say_team","sayEvent")
 
 
p_enable register_cvar("dod_rate_fix","1")    //Plugin on/off | 1=on 0=off
 
p_joinmsg register_cvar("dod_rate_fix_joinmsg","0")   //Turns info message on/off | 1=on 0=off
 
p_timeacmsg register_cvar("dod_rate_fix_msg_delay","30")  //Amount of time in sec. before info msg are shown
 
p_cycleinfo register_cvar("dod_rate_fix_loop_info""0")  //Loop info msg | 1=on 0=off
 
p_infotime register_cvar("dod_rate_fix_set_info_time""600"//Time in sec before info msg is showen again 600 is 10 min :)
 
 //thx vet
 // check if files exisits
 
if(!file_exists(HELP))
  
set_fail_state("[DoD Rate fixer]rate_help.txt does not exsist!")
 if(!
file_exists(HELPURL))
  
set_fail_state("[DoD Rate fixer]rate_tut.txt does not exsist!")
 
 
// Loop info if p_cycleinfo is 1
 
if(get_pcvar_num(p_cycleinfo))
  
set_task(get_pcvar_float(p_infotime),"ShowMsg1",0,"",0,"b")
 
}
public 
client_putinserver(id)

 if(!
is_user_bot(id) && get_pcvar_num(p_enable) && is_user_connected(id) && get_pcvar_num(p_joinmsg))
 {
  
set_task(get_pcvar_float(p_timeacmsg),"ShowMsg",id)
 }
 return 
PLUGIN_CONTINUE
}
public 
ShowMsg(id)

 if(!
is_user_bot(id) && is_user_connected(id)) 
  
client_print(idprint_chat"[DoD Rate fixer] Need help to fix your rates? say /rates in chat to see more info about this..")
 return 
PLUGIN_CONTINUE
}
public 
ShowMsg1()

 
client_print(0print_chat"[DoD Rate fixer] Need help to fix your rates? say /rates in chat to see more info about this..")
 return 
PLUGIN_CONTINUE
}
public 
sayEvent(id)
{
 new 
said[32
 
read_args(said,31)
 
remove_quotes(said)
 
trim(said)
 
 if((
equali(said"/rates")) || (equali(said"!rates"))) 
 {
 
  
show_motd(idHELP,"[DoD Rate fixer] Help screen")
  return 
PLUGIN_CONTINUE
 
 
}
 
 if((
equali(said"/fixmyrates")) || (equali(said"!fixmyrates"))) 
 {
  
client_cmd(id,RATE1)
  
client_cmd(id,RATE2)
  
client_cmd(id,RATE3)
  
client_cmd(id,RATE4)
  
client_cmd(id,RATE5)
  
client_cmd(id,RATE6)
  
client_print(idprint_chat"[DoD Rate fixer] Your rates is now set!")
  return 
PLUGIN_CONTINUE
 

 
 if((
equali(said"/ratetut")) || (equali(said"!ratetut"))) 
 {
  
show_motd(idHELPURL,"dodplugins.net")
  
dod_user_kill(id//kill without death added to score
  
client_cmd(id,"jointeam","3"// join spec
  
return PLUGIN_CONTINUE
 
}
 
 if((
equali(said"/defaultrates")) || (equali(said"!defaultrates"))) 
 {
  
client_cmd(id,D_RATE1)
  
client_cmd(id,D_RATE2)
  
client_cmd(id,D_RATE3)
  
client_cmd(id,D_RATE4)
  
client_cmd(id,D_RATE5)
  
client_cmd(id,D_RATE6)
  
client_print(idprint_chat"[DoD Rate fixer] Your rates is now set to default!")
  return 
PLUGIN_CONTINUE
 
}
 return 
PLUGIN_CONTINUE
 

__________________

Last edited by Dr.G; 03-11-2009 at 09:28.
Dr.G is offline
 



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


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