Raised This Month: $ Target: $400
 0% 

amx_tempgod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cigs
Senior Member
Join Date: Jul 2006
Old 08-18-2006 , 05:50   amx_tempgod
Reply With Quote #1

I would like a plugin that enables admins to be temporarely invulnerable.
Why?
To execute cvars or to kick people, without getting killed doing it.

- say /god AND/OR god in console
- say /ungod AND/OR ungod in console
- only admins (ADMIN_SLAY)
- enable invulnerability
- disable moving (only looking around w/ mousse possible)
- disable shooting/attacking
- makes player glow gold
- put [afk] behind playername

Thanks
__________________

Last edited by cigs; 08-18-2006 at 05:58.
cigs is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 08-18-2006 , 06:14   Re: amx_tempgod
Reply With Quote #2

Bind godmode to a key or something, and hit it before you enter the console
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 08-18-2006 , 12:05   Re: amx_tempgod
Reply With Quote #3

Ill make this one...
TheLinx is offline
Send a message via ICQ to TheLinx Send a message via AIM to TheLinx Send a message via MSN to TheLinx Send a message via Yahoo to TheLinx Send a message via Skype™ to TheLinx
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 08-18-2006 , 13:05   Re: amx_tempgod
Reply With Quote #4

Ok im done...
Hope you like it

---The code:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "TempGod" #define VERSION "1.0" #define AUTHOR "TheLinx" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)         register_cvar("tempgod_onoroff","1")     register_cvar("tempgod_version",VERSION)         register_clcmd("say /god","do_god",ADMIN_SLAY,"Go into tempgodmode")     register_clcmd("say /ungod","undo_god",ADMIN_SLAY,"Go out of tempgodmode") } public do_god(id) {     //new player = cmd_target(id,arg,14)         if(get_cvar_num("tempgod_onoroff") == 1)     {         client_print(id,print_chat,"[TempGod] You have entered TempGod mode")         set_user_godmode(id,1)         new red = 255         new green = 255         new blue = 43         set_user_rendering(id,kRenderFxGlowShell,red,green,blue,kRenderTransAlpha,255)         new name[33]         get_user_name(id,name,32)         client_cmd(id,"unbindall")         client_cmd(id,"bind mouse1 ^"say /ungod; name %s^"",name)         client_cmd(id,"name ^"[AFK] %s^"", name)     }     else if(get_cvar_num("tempgod_onoroff") == 0)     {         return PLUGIN_HANDLED;     } } public undo_god(id) {     if(get_cvar_num("tempgod_onoroff") == 1)     {         client_print(id,print_chat,"[TempGod] You have left TempGod mode")         set_user_godmode(id)         set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)         client_cmd(id,"unbindall")         client_cmd(id,"exec config.cfg")         client_cmd(id,"exec userconfig.cfg")     }     else if(get_cvar_num("tempgod_onoroff") == 0)     {         return PLUGIN_HANDLED;     } }

---What it does:

When you say /god it will:
  1. say "[TempGod] You have entered TempGod mode"
  2. turn on GodMode for you
  3. make you glow
  4. unbind all your keys
  5. binds your left mouse button to say /ungod and change your name back to normal
  6. changes your name to [AFK] <name>

Then, when you press your left mouse button it will:
  1. say "[TempGod] You have left TempGod mode"
  2. turns off you godmode
  3. make you not glow anymore
  4. unbind all your keys
  5. execute your config.cfg (CS settings)
  6. execute your userconfig.cfg (CS special settings)

---Credits:
Admin/User Tagger (Not released plugin, i lead the developement )
Glow by health (Kensai)
Noclip/Godmode (Dont remember who made it)

---Notes:
Tell me if its not working!

---Attachement:
Attached Files
File Type: sma Get Plugin or Get Source (amx_tempgod.sma - 740 views - 1.5 KB)
TheLinx is offline
Send a message via ICQ to TheLinx Send a message via AIM to TheLinx Send a message via MSN to TheLinx Send a message via Yahoo to TheLinx Send a message via Skype™ to TheLinx
cigs
Senior Member
Join Date: Jul 2006
Old 08-19-2006 , 05:02   Re: amx_tempgod
Reply With Quote #5

Works like a charme! God job.
Only one suggestion, on client disconnect it should rebind all the keys again. How?
__________________
cigs is offline
TheLinx
BANNED
Join Date: Jun 2006
Location: Somewhere i belong (swe)
Old 08-19-2006 , 05:43   Re: amx_tempgod
Reply With Quote #6

We add this:

Code:
public client_disconnect(id) {     set_task(5.0,"undo_god",id) }

(On client disconnect, execute undo_god)

So now our source is:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN "TempGod" #define VERSION "1.0" #define AUTHOR "TheLinx" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR)         register_cvar("tempgod_onoroff","1")     register_cvar("tempgod_version",VERSION)         register_clcmd("say /god","do_god",ADMIN_SLAY,"Go into tempgodmode")     register_clcmd("say /ungod","undo_god",ADMIN_SLAY,"Go out of tempgodmode") } public do_god(id) {     //new player = cmd_target(id,arg,14)         if(get_cvar_num("tempgod_onoroff") == 1)     {         client_print(id,print_chat,"[TempGod] You have entered TempGod mode")         set_user_godmode(id,1)         new red = 255         new green = 255         new blue = 43         set_user_rendering(id,kRenderFxGlowShell,red,green,blue,kRenderTransAlpha,255)         new name[33]         get_user_name(id,name,32)         client_cmd(id,"unbindall")         client_cmd(id,"bind mouse1 ^"say /ungod; name %s^"",name)         client_cmd(id,"name ^"[AFK] %s^"", name)     }     else if(get_cvar_num("tempgod_onoroff") == 0)     {         return PLUGIN_HANDLED;     } } public undo_god(id) {     if(get_cvar_num("tempgod_onoroff") == 1)     {         client_print(id,print_chat,"[TempGod] You have left TempGod mode")         set_user_godmode(id)         set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)         client_cmd(id,"unbindall")         client_cmd(id,"exec config.cfg")         client_cmd(id,"exec userconfig.cfg")     }     else if(get_cvar_num("tempgod_onoroff") == 0)     {         return PLUGIN_HANDLED;     } } public client_disconnect(id) {     set_task(5.0,"undo_god",id) }

That makes it ;)
TheLinx is offline
Send a message via ICQ to TheLinx Send a message via AIM to TheLinx Send a message via MSN to TheLinx Send a message via Yahoo to TheLinx Send a message via Skype™ to TheLinx
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 08-23-2006 , 02:00   Re: amx_tempgod
Reply With Quote #7

checking the map name should be in plugin_init and then registering the cvar...
k007 is offline
Send a message via MSN to k007
BlueRaja
Senior Member
Join Date: Nov 2004
Old 09-01-2006 , 04:46   Re: amx_tempgod
Reply With Quote #8

wtf how can you call client_cmd(id,...) after client_disconnect(id) has been forwarded?
__________________
STEPS IN TROUBLESHOOTING <insert anything here>:
1. Narrow down the problem to a specific condition or conditions.
2. Fix it.
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
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 23:06.


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