Raised This Month: $ Target: $400
 0% 

Automatic slay when write /kill HELP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gadzislaw007
Senior Member
Join Date: Nov 2009
Old 07-27-2010 , 21:11   Re: Automatic slay when write /kill
Reply With Quote #1

Hmmm, I think he says that if he types /kill before round ends it will slay him at the end, but it gives him a godmode in this round.


Well, try this.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new godmode[33]

 
public plugin_init()
{
 register_plugin("Death for Godmode","1.0","Gadzik :*")
 register_clcmd("say /kill","cmd_kill")
 register_logevent("Start", 2, "1=Round_Start");
}

public client_connect(id)
{
godmode[id] = 0
}


public cmd_kill(id)
{
	if(godmode[id])
		{
			client_print(id, print_chat, "You already are in a Godmode!")
			return PLUGIN_HANDLED
		}
	
	else
		{
			set_user_godmode(id, 1)
			client_print(id, print_chat, "You are in a Godmode now, but you will die in the next round!")
			godmode[id] = 1
		}
}

public Start()
{
	for(new id = 1; id < 33; id++)
	{
		if(godmode[id])
		{
			set_user_godmode(id, 0)
			client_print(id, print_chat, "You have died, because you were a God already.")
			user_kill(id)
			godmode[id] = 0
		}
	}
}

Last edited by Gadzislaw007; 07-27-2010 at 21:19. Reason: Forgot ;D
Gadzislaw007 is offline
MrMaCEEE
Senior Member
Join Date: Apr 2010
Location: PortugaL
Old 07-29-2010 , 13:44   Re: Automatic slay when write /kill
Reply With Quote #2

Quote:
Originally Posted by Gadzislaw007 View Post
Hmmm, I think he says that if he types /kill before round ends it will slay him at the end, but it gives him a godmode in this round.


Well, try this.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
 
new godmode[33]
 
 
public plugin_init()
{
 register_plugin("Death for Godmode","1.0","Gadzik :*")
 register_clcmd("say /kill","cmd_kill")
 register_logevent("Start", 2, "1=Round_Start");
}
 
public client_connect(id)
{
godmode[id] = 0
}
 
 
public cmd_kill(id)
{
    if(godmode[id])
        {
            client_print(id, print_chat, "You already are in a Godmode!")
            return PLUGIN_HANDLED
        }
 
    else
        {
            set_user_godmode(id, 1)
            client_print(id, print_chat, "You are in a Godmode now, but you will die in the next round!")
            godmode[id] = 1
        }
}
 
public Start()
{
    for(new id = 1; id < 33; id++)
    {
        if(godmode[id])
        {
            set_user_godmode(id, 0)
            client_print(id, print_chat, "You have died, because you were a God already.")
            user_kill(id)
            godmode[id] = 0
        }
    }
}

i will try this thanks a lot for help
__________________

#include ++ by MACE
MrMaCEEE is offline
Send a message via MSN to MrMaCEEE
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 00:07.


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