Help with blocking command
Hey guys, I'm trying to write a code that allows players to use the command "impulse 100" twice every round. This is the very first time I try to write a plugin, so please bear with me. I also wanted it to be applied only to CTs but not Ts, and I have no idea how to do that. Could anyone help?
Thank you Code:
#include <amxmodx>I tried to edit someone's else code that was trying to do something similar |
Re: Help with blocking command
That code only allows once per round. Also, get_user_team().
|
Re: Help with blocking command
Alright I changed the code a little to be applied only to CTs, and added cstrike module. I don't know how to make it to work twice a round rather than once, any hints? Also I am able to compile it, but it does not work
Code:
#include <amxmodx> |
Re: Help with blocking command
Quote:
Regarding the error, see any other working plugin that uses the register_clcmd() command and you will see what you've done wrong. Also, you must check if they are connected (Hint: If they are alive then they are connected) before you can check for their team. |
Re: Help with blocking command
Alright, I'll keep studying and reading around to see if I learn it. Just a quick question though, since I am trying to block a command that is part of counter-strike and not a command that I created, is this gonna work? From what I understand, this code is only gonna show the message rather than blocking the command, am I right?
|
Re: Help with blocking command
Right, it doesn't block anything. I thought you got this from existing working code. I don't even know if this method of hooking that command works. Once you get it to compile you will be able to test it (or I'm sure it's posted somewhere on this forum on how to do it).
My advice is to start very simple and test it (just print a message). Then, you can make it more complex by adding things and testing afterwards. |
Re: Help with blocking command
I based myself off of http://forums.alliedmods.net/showthread.php?p=660187 and http://forums.alliedmods.net/showthread.php?t=178185
I am doing exactly what they did but it is not working. He registers the client command lets say for buy Code:
register_clcmd("buy", "bblocked");Code:
public bblocked(id) |
Re: Help with blocking command
Quote:
Blockcommands uses Code:
register_clcmd("buy", "bblocked");Code:
register_clcmd( "say /guns", "CmdEnableGuns" ); |
Re: Help with blocking command
I figured out that if I include the module engine I can use
Code:
register_impulse(100, "Impulse_100"); |
Re: Help with blocking command
I accomplished what I wanted to. This code allows you to use impulse 100 every 4 second only. Thank you for the help
Final code: Code:
/* Script generated by Pawn Studio */ |
| All times are GMT -4. The time now is 05:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.