Raised This Month: $ Target: $400
 0% 

warning plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
r00ted
New Member
Join Date: Dec 2014
Old 12-14-2014 , 08:31   warning plugin
Reply With Quote #1

As i said, from unknow reason the plugin is not displaying reason why i warned someone, here is the code and sample what say

Code:
Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
	register_plugin("Warning","1.2","r00ted")
	register_concmd("amx_givewarn","cmd_givewarn", ADMIN_RCON, "<userid><reason> - Give warn to player/admins")
}

public cmd_givewarn(id, level, cid)
{
	if(!cmd_access(id, level, cid,2)) {
		return PLUGIN_HANDLED
	}
	else {
		new igrac[32]
		read_argv(1, igrac, 31)
		new player = cmd_target(id, igrac, CMDTARGET_ALLOW_SELF || CMDTARGET_NO_BOTS)
		
		if (!player) {
			return PLUGIN_HANDLED
		}
		
		
		new admin[32]
		read_argv(2, admin, 31)
		get_user_name(id, admin, 30)
		new reason[32];
		read_argv(3, reason, 31)
		client_print(id,print_console,"You give warn to %s",player)
		client_print(player,print_chat,"Admin %s give warn to you. reason: %s",admin, reason)
		client_print(0,print_chat,"Admin%s give warn to %s. reason: %s",admin, player, reason)
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}
Example what says:
Code:
Admin r00ted give warn to you.reason:
I been write amx_givewarn r00ted "rules" as reason, but not working... I'm thinking why?

Last edited by r00ted; 12-14-2014 at 08:50.
r00ted is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-14-2014 , 08:49   Re: warning plugin
Reply With Quote #2

You have to write amx_givewarn in the console as your code:
Code:
register_concmd("amx_givewarn","cmd_givewarn", ADMIN_RCON, "<userid><reason> -
By the way, are you the author of this code?

Last edited by zmd94; 12-14-2014 at 08:49.
zmd94 is offline
r00ted
New Member
Join Date: Dec 2014
Old 12-14-2014 , 08:49   Re: warning plugin
Reply With Quote #3

Yes, i know but not working, now showing "reason", if you understand me.
r00ted is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-14-2014 , 09:28   Re: warning plugin
Reply With Quote #4

AMX Warn 2.0

How to use it?

Just open your console, then write amx_warn Fateh94 "Server rules!".

amx_warn = The command.
Fateh94 = Player name.
"Server rules!" = The reason. Please write the reason in " ".

Screenshots:



Attached Files
File Type: sma Get Plugin or Get Source (amx_warn.sma - 586 views - 1.1 KB)

Last edited by zmd94; 12-14-2014 at 12:49.
zmd94 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-14-2014 , 12:29   Re: warning plugin
Reply With Quote #5

You must use a bitwise OR for the cmd_target() flags, not a logical OR.
__________________
fysiks is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-14-2014 , 12:36   Re: warning plugin
Reply With Quote #6

May you explain a little bit about it?

Edit: Nevermind, I got it. ;)
Code:
#define CMDTARGET_OBEY_IMMUNITY (1<<0)
#define CMDTARGET_ALLOW_SELF    (1<<1)
#define CMDTARGET_ONLY_ALIVE    (1<<2)
#define CMDTARGET_NO_BOTS        (1<<3)
I will update the code.

Last edited by zmd94; 12-14-2014 at 12:46.
zmd94 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 15:26.


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