AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   amx_tempgod (https://forums.alliedmods.net/showthread.php?t=43400)

cigs 08-18-2006 05:50

amx_tempgod
 
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

BlueRaja 08-18-2006 06:14

Re: amx_tempgod
 
Bind godmode to a key or something, and hit it before you enter the console

TheLinx 08-18-2006 12:05

Re: amx_tempgod
 
Ill make this one...

TheLinx 08-18-2006 13:05

Re: amx_tempgod
 
1 Attachment(s)
Ok im done...
Hope you like it :D

---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 :D)
Glow by health (Kensai)
Noclip/Godmode (Dont remember who made it)

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

---Attachement:

cigs 08-19-2006 05:02

Re: amx_tempgod
 
Works like a charme! God job. :up:
Only one suggestion, on client disconnect it should rebind all the keys again. How?

TheLinx 08-19-2006 05:43

Re: amx_tempgod
 
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 ;)

gekkenwerk 08-19-2006 06:32

Re: amx_tempgod
 
Now the questoin how to make this only for ka_maps??

TheLinx 08-19-2006 09:26

Re: amx_tempgod
 
OMG!


I dont know.....

TheLinx 08-21-2006 10:23

Re: amx_tempgod
 
w00t! found out how to make it ka_ maps only :D

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 mapname[32]     get_mapname(mapname,31)         if(contain(mapname,"ka_"))     {         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) }


dont worry, be happy

cigs 08-21-2006 18:39

Re: amx_tempgod
 
TheLinx, could you make it so people's screen fade to black when tempgoding and (instant) unfades back to transparent instead of unbinding keys?


All times are GMT -4. The time now is 23:07.

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