Raised This Month: $51 Target: $400
 12% 

[REQ] God Mode for 20 sec (untouchable)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RoaR
Member
Join Date: Dec 2011
Old 04-20-2012 , 13:48   [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #1

I need a plugin when someone type's /god (for example) he get's god mode (damage not working on him) for 20 seconds.

If someone could makes this i would be very pleased? Thankys
RoaR is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-20-2012 , 15:39   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #2

Code:
#include < amxmodx > #include < fun > new bool:g_bGodMode[ 33 ]; public plugin_init( ) {     register_clcmd( "say /god", "ClientCommand_God" ); } public ClientCommand_God( id ) {     if( is_user_alive( id ) && !g_bGodMode[ id ] )     {         set_user_godmode( id, 1 );         set_task( 20.0, "RemoveGodmode", id );         g_bGodMode[ id ] = true     } } public RemoveGodmode( id ) {     if( is_user_alive( id ) )     {         set_user_godmode( id, 0 )         g_bGodMode[ id ] = false;     } } public client_disconnect( id ) {     remove_task( id ); }
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 04-21-2012 at 06:39.
Devil259 is offline
RoaR
Member
Join Date: Dec 2011
Old 04-21-2012 , 04:13   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #3

Thanks, your the best.
RoaR is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-21-2012 , 06:33   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #4

No problem, I forgot to remove the task when player disconnect. Edited.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-21-2012 , 06:34   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #5

Better would be to check is_user_alive inside RemoveGodmode, since you can get errors if the player is dead.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-21-2012 , 06:41   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #6

I thought about that, but how can he die by being invincible ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-21-2012 , 08:50   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #7

No idea.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
kapzz
Member
Join Date: Mar 2012
Location: Mars
Old 04-21-2012 , 12:30   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #8

hahah maybe "kill" on console will kill him.
kapzz is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-21-2012 , 13:32   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #9

Yes, you're right. "Slay" admin command too.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 04-21-2012 , 13:41   Re: [REQ] God Mode for 20 sec (untouchable)
Reply With Quote #10

Quote:
Originally Posted by Devil259 View Post
I thought about that, but how can he die by being invincible ?
Godmode or not, a few things that could kill him may be something along the lines of being hit by a vehicle.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 18:36.


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