Raised This Month: $ Target: $400
 0% 

Restricting commands (NS)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 07-08-2005 , 10:44   Restricting commands (NS)
Reply With Quote #1

First plugin on my career, woohoo.

But I'm actually stuck. I'm trying to rectrict commands in NS that would allow someone to evolve into another life form, and for the character to not be able to upgrade his weapon choice.

I've tried using the fullupdate blocker from JPT, but unfortunetly it didn't work as well as I wanted it too. This is what I had but it still allowed for the impulses to be used, whether in the console or in the pop up menu for NS combat.

Code:
#include <amxmodx>

public plugin_init() {
	register_plugin("LMG/Skulk Combat","1.0","v3xtra")
	register_clcmd("impulse 118","noupgrade")
	register_clcmd("impulse 39","noupgrade")
	register_clcmd("impulse 38","noupgrade")
	register_clcmd("impulse 126","noupgrade")
	register_clcmd("impulse 114","noupgrade")
	register_clcmd("impulse 115","noupgrade")
	register_clcmd("impulse 116","noupgrade")
	register_clcmd("impulse 117","noupgrade")
	register_clcmd("impulse 64","noupgrade")
	register_clcmd("impulse 65","noupgrade")
	register_clcmd("impulse 66","noupgrade")
	register_clcmd("impulse 37","noupgrade")
	register_clcmd("impulse 61","noupgrade")
	register_clcmd("impulse 111","noupgrade")
}


public noupgrade(id) {

client_print(print_chat, id, "Sorry but you cannot buy that upgrade!")

	return PLUGIN_HANDLED
}
I'm going to take a wild guess that it probably has something to do with the id that is there, but I get absolutely no warnings/errors when compiled online, which works because I don't have any custom includes needed, like the ns.inc.

I'm just wondering why it's not working correctly, so thanks again for helpin' me (hopefully v3x will help as he knows what I'm talking about with NS. )

Oh, and one last thing. I'm trying to restrict the command from even being used because if it is used, I'm not sure if they can evolve back to skulk using a constant in the ns.inc. It's co_, and it wasn't designed for evolving back skulk, although I don't see why you couldn't. But the best thing to do would be to restrict it period so that if they wouldn't lose a point for evolving and that they wouldn't have to waste time in evolving back and forth.
__________________
f1del1ty.oXi is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 07-08-2005 , 11:38  
Reply With Quote #2

client_print(id,print_chat, "Sorry but you cannot buy that upgrade!")
DahVid is offline
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 07-09-2005 , 15:14  
Reply With Quote #3

Could you please read everything I've written.

There are no warnings when I compile, and even what you told me to use did not work.

The problem is not so much making it print, it's that I can still use the impulses I'm trying to block. I don't even really care so much about the messages I'm going to print to the client. =\
__________________
f1del1ty.oXi is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-09-2005 , 15:28  
Reply With Quote #4

register_impulse
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 07-09-2005 , 15:51  
Reply With Quote #5

Hmm, okedokey.

But do I need to do register_impulse and do impulse 81 or just 81?
__________________
f1del1ty.oXi is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-09-2005 , 15:59  
Reply With Quote #6

What about client_impulse?

Code:
public client_impulse(id,impulse) {     if(impulse == 101)     {         // ...     } }
__________________
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
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 07-09-2005 , 16:02  
Reply With Quote #7

lemme give that a try.

What's the thing for or? is it ||?
__________________
f1del1ty.oXi is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-09-2005 , 16:12  
Reply With Quote #8

What are you trying to do? Block impulses?
Code:
public client_impulse(id,impulse)     return PLUGIN_HANDLED
__________________
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
f1del1ty.oXi
Veteran Member
Join Date: Nov 2004
Old 07-09-2005 , 16:21  
Reply With Quote #9

I am. I'm wanting people to only be able to choose certain upgrades. This is currently what I have but it's still allowing me to choose the weapon I'm trying to restrict.

Code:
#include <amxmodx>
#include <engine>

public plugin_init() {
	register_plugin("LMG/Skulk Combat","1.0","v3xtra")
}


public client_impulse(id,impulse) {

	if(impulse == 118 || 39 || 38 || 126 || 114 || 115 || 116 || 117 || 64 || 65 || 66 || 37 || 61 || 11){
	client_print(id,print_chat, "Sorry but you cannot buy that upgrade!")

	return PLUGIN_HANDLED

		}
}
It seems that 118 doesn't work, but everything else does.
__________________
f1del1ty.oXi is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-09-2005 , 16:23  
Reply With Quote #10

Code:
public client_impulse(id,impulse) {     client_print(id,print_chat, "Sorry but you cannot buy that upgrade!")     return PLUGIN_HANDLED }
Should work for all of them..
__________________
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
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 10:04.


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