Raised This Month: $ Target: $400
 0% 

1 command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
InteX01
Senior Member
Join Date: Jan 2017
Old 01-22-2017 , 09:06   1 command
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <colorchat>

#define PLUGIN "ADMIN FUN PLUGIN"
#define VERSION "1.0"
#define AUTHOR "InteX"

public plugin_init() {
	register_clcmd("say /noclipon", "NoClipON")
	register_clcmd("say /noclipoff", "NoClipOFF")
}
public NoClipON(id)
{
	if(get_user_flags(id) & ADMIN_RCON)
	{
		set_user_noclip (id, 1)
		ColorChat(id, GREEN, "[AdminFun] ^3You turned on noclip.")
	}
	else
	{
		{
			if(get_user_flags(id) & ADMIN_USER)
			{
				ColorChat(id, GREEN, "[AMXX] ^3You dont have access to this command.")
			}
		}
	}
	return PLUGIN_HANDLED;
}
public NoClipOFF(id)
{
	if(get_user_flags(id) & ADMIN_RCON)
	{
		set_user_noclip (id, 0)
		ColorChat(id, GREEN, "[AdminFun] ^3You turned off noclip.")
	}
	else
	{
		{
			if(get_user_flags(id) & ADMIN_USER)
			{
				ColorChat(id, GREEN, "[AMXX] ^3You dont have access to this command.")
			}
		}
	}
	return PLUGIN_HANDLED;
}
This is only part of plugin.
Im begginer at scripting and my question is:
Can i somehow make both like switching ON/OFF with one command /noclip but to keep this "You dont have access...."
So i dont need to use /noclipon and /noclipoff
And yeah if u can give me some advices if i done something wrong or.....

Thanks.

Last edited by InteX01; 01-22-2017 at 09:15.
InteX01 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 20:49.


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