Raised This Month: $ Target: $400
 0% 

Strange Bug plz help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 06-07-2005 , 08:32   Strange Bug plz help
Reply With Quote #1

I written this script for users in my clan to start wars ect with but there is a strange bug in it, when ever you run the script it works but you cant say anything, only in team_say can you talk.
under normal say nothing shows up, i have no idea whats going on so please help.

Code:
//Author:   Anthrax //Date:     07 June 2005 /* Commands     amx_war - Starts the script     say /password - shows the server password     say /nopassword - removes the password     say /generate - generates a new password     say /war - starts a war     say /restore - restores server back to normal */ #include <amxmodx> #include <amxmisc> new Plugin[] = "War Script" new Author[] = "AnthraX" new Version[] = "2.0" public plugin_init() {     register_plugin(Plugin,Version,Author)     register_concmd("amx_war","cmd_war",ADMIN_MAP," Starts a war on the server")     register_clcmd("say","check_input",ADMIN_MAP,"Checks for input") } //---------------------------------------------------------------------------------------- public cmd_war(id,level,sid) {     if ( ! cmd_access(id,level,sid,0))     {         console_print(id,"You have no access to that command")         return PLUGIN_HANDLED     }     set_cvar_string("mp_friendlyfire","1")     set_cvar_string("mp_forcechasecam","2")     set_cvar_string("mp_freezetime","10")     set_cvar_string("mp_Autokick","0")     set_cvar_string("mp_AutoTeambalance","0")     set_cvar_string("mp_Limitteams","0")     set_cvar_string("mp_timelimit","60")     set_cvar_string("mp_buytime",".5")     set_cvar_string("mp_c4timer","35")     set_cvar_string("mp_fadetoblack","0")     set_cvar_string("mp_autocrosshair","0")     set_cvar_string("mp_flashlight","1")     set_cvar_string("mp_fraglimit","0")     set_cvar_string("mp_maxrounds","0")     set_cvar_string("mp_tkpunish","0")     set_cvar_string("mp_winlimit","0")     set_cvar_string("mp_maxrounds","0")     set_cvar_string("sv_gravity","800")     set_cvar_string("sv_alltalk","0")     set_cvar_string("sv_aim","0")     set_cvar_string("sv_cheats","0")     set_cvar_string("pausable","0")         set_hudmessage(0, 200, 0, -1.0, 0.40, 0, 6.0, 6.0, 0.1, 0.1, 1)     show_hudmessage(0,"Live In 3 Restarts")             set_task(3.0, "restart")         set_task(6.0, "restart")     set_task(9.0, "restart")         set_task(11.0, "live")     set_task(14.0, "password_generator")     return PLUGIN_HANDLED } //---------------------------------------------------------------------------------------- public check_input(id,level,sid) {     if ( ! cmd_access(id,level,sid,0))     {         client_print(id, print_chat,"You have no access to that command")         return PLUGIN_HANDLED     }     new message[20]     read_args(message,18)     remove_quotes(message)             if (containi(message,"/password")!= -1)     {         cmd_pw(id)     }     if(containi(message,"/generate") != -1)     {         password_generator()     }     if(containi(message,"/nopassword") != -1)     {         cmd_nopw()     }     if(containi(message,"/warhelp") != -1)     {          show_motd(id, "addons/amxmodx/configs/warhelp.txt")     }     if(containi(message,"/war") != -1)     {         cmd_war(id,level,sid)     }     if(containi(message,"/restore") != -1)     {         cmd_unwar(id,level,sid)     }     return PLUGIN_HANDLED     } //---------------------------------------------------------------------------------------- public restart() {     set_cvar_string("sv_restart","1") } //---------------------------------------------------------------------------------------- public live() {     set_hudmessage(0, 200, 0, -1.0, 0.40, 0, 6.0, 6.0, 0.1, 0.1, 1)     show_hudmessage(0,"Live Go Go Go")     show_hudmessage(0,"Live Go Go Go")     show_hudmessage(0,"Live Go Go Go") } //---------------------------------------------------------------------------------------- public password_generator() {     new password[6]             num_to_str(random_num( 0,9 ), password[0], 1)     num_to_str(random_num( 0,9 ), password[1], 1)     num_to_str(random_num( 0,9 ), password[2], 1)     num_to_str(random_num( 0,9 ), password[3], 1)     num_to_str(random_num( 0,9 ), password[4], 1)     set_cvar_string("sv_password", password)     client_print(0, print_chat, "Server Password is: %s",password)     client_print(0, print_chat, "Server Password is: %s",password)     client_print(0, print_chat, "Server Password is: %s",password)     client_print(0, print_chat, "Server Password is: %s",password)     client_print(0, print_chat, "Server Password is: %s",password)          return PLUGIN_HANDLED   } //---------------------------------------------------------------------------------------- public cmd_pw(id) {     new password[6]     get_cvar_string("sv_password",password,6)     client_print(id, print_chat,"Server Password is: %s",password)     client_print(id, print_chat,"Server Password is: %s",password)     client_print(id, print_chat,"Server Password is: %s",password) } //---------------------------------------------------------------------------------------- public cmd_nopw() {     set_cvar_string("sv_password","")     client_print(0, print_chat, "Server Password Has Been Removed %s")     client_print(0, print_chat, "Server Password Has Been Removed %s")     client_print(0, print_chat, "Server Password Has Been Removed %s") } //---------------------------------------------------------------------------------------- public cmd_unwar(id,level,sid) {     if ( ! cmd_access(id,level,sid,0))     {         console_print(id,"You have no access to that command")         return PLUGIN_HANDLED     }     set_cvar_string("mp_friendlyfire","0")     set_cvar_string("mp_forcechasecam","0")     set_cvar_string("mp_freezetime","6")     set_cvar_string("mp_Autokick","1")     set_cvar_string("mp_AutoTeambalance","1")     set_cvar_string("mp_Limitteams","0")     set_cvar_string("mp_timelimit","30")     set_cvar_string("mp_buytime",".5")     set_cvar_string("mp_c4timer","35")     set_cvar_string("mp_fadetoblack","0")     set_cvar_string("mp_autocrosshair","0")     set_cvar_string("mp_flashlight","1")     set_cvar_string("mp_fraglimit","0")     set_cvar_string("mp_maxrounds","0")     set_cvar_string("mp_tkpunish","1")     set_cvar_string("mp_winlimit","0")     set_cvar_string("mp_maxrounds","0")     set_cvar_string("sv_gravity","800")     set_cvar_string("sv_alltalk","0")     set_cvar_string("sv_aim","0")     set_cvar_string("sv_cheats","0")     set_cvar_string("pausable","0")         set_hudmessage(0, 200, 0, -1.0, 0.40, 0, 6.0, 6.0, 0.1, 0.1, 1)     show_hudmessage(0,"Restoring Server")         set_cvar_string("sv_password","")     set_cvar_string("sv_restart","1")         client_print(0,print_chat,"Server Password Removed %s")     client_print(0,print_chat,"Server Password Removed %s")         return PLUGIN_HANDLED } //----------------------------------------------------------------------------------------
Anthraxnz is offline
CoolKiller
Member
Join Date: Jun 2005
Location: Denmark
Old 06-07-2005 , 09:38   Maaybe
Reply With Quote #2

Maybe you made a plugin_handled insteaf of plugin_return? Just my buest guess.. i suck at this
__________________
I TOLD you I sucked at this!!

http://www.amxmodx.org/forums/viewtopic.php?t=14504
Cool
CoolKiller is offline
Send a message via MSN to CoolKiller
More
Member
Join Date: Nov 2004
Location: Internet
Old 06-07-2005 , 09:53  
Reply With Quote #3

Code:
public check_input(id,level,sid) {     if ( ! cmd_access(id,level,sid,0))     {         client_print(id, print_chat,"You have no access to that command")         return PLUGIN_HANDLED     }     new message[20]     read_args(message,18)     remove_quotes(message)             if (containi(message,"/password")!= -1)     {         cmd_pw(id)     }     if(containi(message,"/generate") != -1)     {         password_generator()     }     if(containi(message,"/nopassword") != -1)     {         cmd_nopw()     }     if(containi(message,"/warhelp") != -1)     {             show_motd(id, "addons/amxmodx/configs/warhelp.txt")     }     if(containi(message,"/war") != -1)     {         cmd_war(id,level,sid)     }     if(containi(message,"/restore") != -1)     {         cmd_unwar(id,level,sid)     }     return PLUGIN_CONTINUE // here i let the say command reach the server and let it be printed out (PLUGIN_HANDLED had blocked this)     }
More is offline
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 06-07-2005 , 17:58  
Reply With Quote #4

thnks will give it a go
Anthraxnz is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-07-2005 , 18:16  
Reply With Quote #5

Or if you want to block that text from showing up, but not block regular chat text..

Code:
public check_input(id,level,sid) {     if ( ! cmd_access(id,level,sid,0))     {         client_print(id, print_chat,"You have no access to that command")         return PLUGIN_HANDLED     }     new message[20]     read_args(message,18)     remove_quotes(message)             if (containi(message,"/password")!= -1)     {         cmd_pw(id)         return PLUGIN_HANDLED     }     if(containi(message,"/generate") != -1)     {         password_generator()         return PLUGIN_HANDLED     }     if(containi(message,"/nopassword") != -1)     {         cmd_nopw()         return PLUGIN_HANDLED     }     if(containi(message,"/warhelp") != -1)     {         show_motd(id, "addons/amxmodx/configs/warhelp.txt")         return PLUGIN_HANDLED     }     if(containi(message,"/war") != -1)     {         cmd_war(id,level,sid)         return PLUGIN_HANDLED     }     if(containi(message,"/restore") != -1)     {         cmd_unwar(id,level,sid)         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE // here i let the say command reach the server and let it be printed out (PLUGIN_HANDLED had blocked this)     }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 06-08-2005 , 07:54  
Reply With Quote #6

thanks, that works good. also i got another question.

when i type /warhelp its susposed to bring up the text file.
that works fine except if you miss spell it say you type /warmenu it runs the /war command. any ideas?
Anthraxnz is offline
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 06-08-2005 , 07:57  
Reply With Quote #7

thats not our fault and its impossible to make him not "misspell" the word...
__________________
Plugins:
none

n0obie4life is offline
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 06-08-2005 , 08:22  
Reply With Quote #8

dont flame.

i said if u type /warfog which isnt a valid command it starts the war.

also for some reason, only admins can talk now, normal players cant use say only team say
Anthraxnz is offline
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 06-08-2005 , 08:39  
Reply With Quote #9

i didn't attempt to flame at all.

and what you said just now, and what you said now, is totally different!!!!!

change all of them from
Code:
containi
to
Code:
equali
__________________
Plugins:
none

n0obie4life is offline
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 06-08-2005 , 09:02  
Reply With Quote #10

k thanks, i found the problem for why it stops no admins from talking, when it checks to see if your an admin. if you are then it continues, but if your not it denies you access to the say fuction :S
Anthraxnz 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 16:35.


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