Raised This Month: $ Target: $400
 0% 

An idea for plugin that allows admins godmode while typing.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dissonantallure
Member
Join Date: Apr 2008
Old 06-06-2008 , 13:27   An idea for plugin that allows admins godmode while typing.
Reply With Quote #1

Hello everyone I have been super busy lately with work and everything so i haven't had time to write anything. I need a plugin for my server that is basically a modified godmode. It would be really easy to write and I don't have the time so If this plugin already exists maybe you can send me a link if not than maybe you can write it and take credit for the idea .


PLUGIN:

A: Check if player is admin

B: Check if they are typing

C: Set godmode if user is A+B



I have NO TIME. So if anyone can help I would appreciate it. If not I will write it for myself whenever I have time. Thanks people.


How's my title now?
__________________

Last edited by dissonantallure; 06-07-2008 at 14:42.
dissonantallure is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-06-2008 , 13:35   Re: Great Idea For Plugin!
Reply With Quote #2

Before somebody claims this isn't possible, I can write it for you, but only because it's for members of your clan - as it involves an element of trust.

You'll have to be somewhat patient.

Could you tell me how you were going detect if they had cancelled the message? I know how I will, but I don't think this is as easy as you're making out.

Last edited by Lee; 06-06-2008 at 13:57.
Lee is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 06-06-2008 , 14:28   Re: Great Idea For Plugin!
Reply With Quote #3

Yeah you can use ham or just use a traceline and tracehud to block dmg.
And FM_CmdStart should be triggered if they start typing.
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 06-06-2008 at 14:34.
fxfighter is offline
Send a message via MSN to fxfighter
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-06-2008 , 15:42   Re: Great Idea For Plugin!
Reply With Quote #4

Quote:
Originally Posted by fxfighter View Post
Yeah you can use ham or just use a traceline and tracehud to block dmg.
And FM_CmdStart should be triggered if they start typing.
Trace line? What the hell is trace hud? To enable god mode? What would be wrong with.. I don't know.. set_user_godmode() or the equivalant set_pev(_, pev_takedamage, _)? I.. wow.. just.. wow.

FM_CmdStart doesn't detect client-side functionality either. I'm dumbfounded.

Last edited by Lee; 06-06-2008 at 16:12.
Lee is offline
Old 06-06-2008, 17:31
fxfighter
This message has been deleted by fxfighter. Reason: gfaw
stupok
Veteran Member
Join Date: Feb 2006
Old 06-06-2008 , 18:34   Re: Great Idea For Plugin!
Reply With Quote #6

fxfighter, set_user_godmode() will suffice

Anyways, here's my idea:

1. The admin does: bind y "gs_god;messagemode"
2. The server waits for a chat message to be sent by the admin. If the admin sent a chat message and the admin has godmode, remove his godmode.

So, every time the admin pushes the Y key to talk he'll turn on his godmode, and every time the server receives his chat message, his godmode will be removed.

It's not excellent because it requires the admin to change his Y key, but it works.

What do you think?

EDIT: I was bored, so I wrote it. It works great! (This plugin will interfere with other godmode plugins. This is just the barebones version to prove that my idea works.)

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

#define PLUGIN	"Godmode on Say"
#define AUTHOR	"stupok69"
#define VERSION	"1.0"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("gs_god", "enable_god", ADMIN_KICK, "enables godmode")
	register_clcmd("say", "chat_handler")
}

public enable_god(id, level, cid)
{
	if(!cmd_access(id, level, cid, 0))
		return PLUGIN_HANDLED
	
	set_user_godmode(id, 1)
	
	return PLUGIN_HANDLED
}

public chat_handler(id)
{
	set_user_godmode(id, 0)
}
__________________

Last edited by stupok; 06-06-2008 at 18:55.
stupok is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-06-2008 , 19:32   Re: Great Idea For Plugin!
Reply With Quote #7

Shorter than I thought.. This won't interfere with other god mode plugins. It's very rare that I get to use the trusty x = !x.

Code:
#include <amxmisc> #include <fun> new bool:isOn[33]; public plugin_init() {     register_plugin("Godmode When Typing", "1.0", "Lee");     register_clcmd("amx_typing", "toggleGodMode", _, "Toggles godmode.");     register_clcmd("say", "onSay");     register_clcmd("say_team", "onSay"); } public client_authorized(id) {     if(is_user_admin(id))     {         client_cmd(id, "bind y ^"messagemode;amx_typing^"; bind u ^"messagemode2;amx_typing^";bind ESCAPE ^"cancelselect;amx_typing^"");     } } public onSay(id) {     toggleGodMode(id); } public toggleGodMode(id) {     if(is_user_admin(id))     {         set_user_godmode(id, isOn[id]? 0 : 1);         isOn[id] = !isOn[id];     }         return PLUGIN_HANDLED; }
In practice my use of x = !x introduces a bug where if a player accidentally hits y and u at the same time, god mode will be enabled only when the server receives the message. Unfortunately, I don't care. Combine our two versions. ;)

I paid stupod69 in karma for this nitpick he doesn't deserve..

Code:
public enable_god(id, level, cid) {     if(cmd_access(id, level, cid, 0))         set_user_godmode(id, 1)         return PLUGIN_HANDLED }

Last edited by Lee; 06-07-2008 at 06:19.
Lee is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-06-2008 , 20:16   Re: Great Idea For Plugin!
Reply With Quote #8

Quote:
Originally Posted by Lee View Post
Code:
public toggleGodMode(id) {     if(is_user_admin(id))     {         set_user_godmode(id, isOn[id]? 0 : 1);         isOn = !isOn;     }         return PLUGIN_HANDLED; }
Code:
public toggleGodMode(id) {     if(is_user_admin(id))     {         set_user_godmode(id, isOn[id]? 0 : 1);         isOn[id] = !isOn[id];     }         return PLUGIN_HANDLED; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-06-2008 , 20:18   Re: Great Idea For Plugin!
Reply With Quote #9

Thanks.
Lee is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 06-07-2008 , 01:59   Re: Great Idea For Plugin!
Reply With Quote #10

Lee, did you have a totally different idea than mine, or did I just post faster?
__________________
stupok 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 19:41.


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