AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Automatic slay when write /kill HELP (https://forums.alliedmods.net/showthread.php?t=133627)

MrMaCEEE 07-27-2010 08:36

Automatic slay when write /kill HELP
 
Hi, when the player write /kill on round end or when all the team die this player die too.
eg: I write /kill - i have godmode and when round end i got slay automatic or when all the terrorist team die i got slay too

PHP Code:

#include <amxmodx>
#include <cstrike>
#include <amxmisc>
#include <fun>
new g_ExecCmds[][] =
{
        
"amxx unpause killmeonend.amxx",
        
"amxx pause notkill.amxx"
};
 
public 
plugin_init()
{
 
register_plugin("Kill Me On End","1.0","MACE")
 
register_clcmd("say /kill","HandleReady")
 
register_logevent("RoundStart"2"1=Round_Start");
}
public 
HandleReady(id)
{
 
 if(
cs_get_user_teamid ) == CS_TEAM_T) {
                new 
target_name[32]
  
client_print(id,print_chat,"[ARENA] When round end you got slay.")
  
set_user_godmode(id,1)
 
  
get_user_name(id,target_name,31)
  
client_print(0,print_chat,"[ARENA] %s sera morto automaticamente no final da ronda.",target_name)
  
server_cmd"amxx unpause notkill.amxx" )
  
set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,25)
  
server_cmd"amxx pause killmeonend.amxx" )
 
 }else{
  
client_print(id,print_chat,"[ARENA] Only terrorist team can use this command.")
 }
 
}
 
public 
RoundStart()
        for (new 
Cmd 0Cmd sizeof(g_ExecCmds); Cmd++)
                
server_cmd(g_ExecCmds[Cmd]); 

Sorry for my bad english

Kreation 07-27-2010 15:53

Re: Automatic slay when write /kill
 
1. I don't really understand what you want.
2. You didn't say what's wrong with it.

Alucard^ 07-27-2010 17:40

Re: Automatic slay when write /kill
 
Kill in console? :S

Gadzislaw007 07-27-2010 21:11

Re: Automatic slay when write /kill
 
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
                }
        }
}


MrMaCEEE 07-29-2010 13:44

Re: Automatic slay when write /kill
 
Quote:

Originally Posted by Gadzislaw007 (Post 1253686)
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 :)


All times are GMT -4. The time now is 00:08.

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