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

Death Match plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
farhanhyper
Member
Join Date: Dec 2017
Location: Finland
Old 07-16-2018 , 15:33   Death Match plugin
Reply With Quote #1

Hi, I need a plugin that when I say /dm1 players respawn after their death and when I say /dm0 deactivate the plugin.
farhanhyper is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-17-2018 , 06:32   Re: Death Match plugin
Reply With Quote #2

PHP Code:
/* AMX Mod X script. 

* (c) Copyright 2002-2003, f117bomb 
* This file is provided as is (no warranties). 

*  *******************************************************************************
*   
*    Ported By KingPin( [email protected] ). I take no responsibility 
*    for this file in any way. Use at your own risk. No warranties of any kind. 
*
*  *******************************************************************************
*
* Set Cvar 'amx_respawn' 1 or 0 

*/ 

#include <amxmodx>
#include <fun>

new g_respawn

public TeamSelect(id)
{
    if(
get_cvar_num("amx_respawn") == 1)
    {
        new 
sId[2]
        
sId[0] = id
        set_task
(10.0,"respawn"0sId2)
    }
    return 
PLUGIN_CONTINUE
}

public 
death_msg() 
{
    if(
get_cvar_num("amx_respawn") == 1)
    { 
        new 
vIndex read_data(2
        new 
svIndex[2]
        
svIndex[0] = vIndex
        set_task
(0.5,"respawn"0svIndex2
    } 
    return 
PLUGIN_CONTINUE 
}

public 
respawn(svIndex[]) 

    new 
vIndex svIndex[0]

    if(
get_user_team(vIndex) == || is_user_alive(vIndex)) 
        return 
PLUGIN_CONTINUE

    spawn
(vIndex)
    
    return 
PLUGIN_CONTINUE
}

public 
dm_on()
{
    
set_pcvar_num(g_respawn1);
}

public 
dm_off()
{
    
set_pcvar_num(g_respawn0);
}

public 
plugin_init() 
{
       
register_plugin("amx_respawn","0.9.4","f117bomb")
    
register_event("DeathMsg","death_msg","a")
    
register_event("ShowMenu","TeamSelect","b","4&Team_Select")
    
register_event("VGUIMenu","TeamSelect","b","1=2")
    
g_respawn register_cvar("amx_respawn""0")
    
register_clcmd("say /dm1""dm_on")
    
register_clcmd("say /dm0""dm_off")

    return 
PLUGIN_CONTINUE

D4rkSiD3Rs is offline
farhanhyper
Member
Join Date: Dec 2017
Location: Finland
Old 07-17-2018 , 08:16   Re: Death Match plugin
Reply With Quote #3

Quote:
Originally Posted by D4rkSiD3Rs View Post
PHP Code:
/* AMX Mod X script. 

* (c) Copyright 2002-2003, f117bomb 
* This file is provided as is (no warranties). 

*  *******************************************************************************
*   
*    Ported By KingPin( [email protected] ). I take no responsibility 
*    for this file in any way. Use at your own risk. No warranties of any kind. 
*
*  *******************************************************************************
*
* Set Cvar 'amx_respawn' 1 or 0 

*/ 

#include <amxmodx>
#include <fun>

new g_respawn

public TeamSelect(id)
{
    if(
get_cvar_num("amx_respawn") == 1)
    {
        new 
sId[2]
        
sId[0] = id
        set_task
(10.0,"respawn"0sId2)
    }
    return 
PLUGIN_CONTINUE
}

public 
death_msg() 
{
    if(
get_cvar_num("amx_respawn") == 1)
    { 
        new 
vIndex read_data(2
        new 
svIndex[2]
        
svIndex[0] = vIndex
        set_task
(0.5,"respawn"0svIndex2
    } 
    return 
PLUGIN_CONTINUE 
}

public 
respawn(svIndex[]) 

    new 
vIndex svIndex[0]

    if(
get_user_team(vIndex) == || is_user_alive(vIndex)) 
        return 
PLUGIN_CONTINUE

    spawn
(vIndex)
    
    return 
PLUGIN_CONTINUE
}

public 
dm_on()
{
    
set_pcvar_num(g_respawn1);
}

public 
dm_off()
{
    
set_pcvar_num(g_respawn0);
}

public 
plugin_init() 
{
       
register_plugin("amx_respawn","0.9.4","f117bomb")
    
register_event("DeathMsg","death_msg","a")
    
register_event("ShowMenu","TeamSelect","b","4&Team_Select")
    
register_event("VGUIMenu","TeamSelect","b","1=2")
    
g_respawn register_cvar("amx_respawn""0")
    
register_clcmd("say /dm1""dm_on")
    
register_clcmd("say /dm0""dm_off")

    return 
PLUGIN_CONTINUE

oh,that works perfectly and can you create another one for /map?

when I say /map it shows changelevel menu for me.
farhanhyper is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-17-2018 , 08:35   Re: Death Match plugin
Reply With Quote #4

Quote:
Originally Posted by farhanhyper View Post
oh,that works perfectly and can you create another one for /map?

when I say /map it shows changelevel menu for me.
Ever heard of amx_mapmenu?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
farhanhyper
Member
Join Date: Dec 2017
Location: Finland
Old 07-18-2018 , 04:41   Re: Death Match plugin
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Ever heard of amx_mapmenu?

Yes I heard but when I put that in the plugin It Doesnt work.
farhanhyper is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-18-2018 , 05:00   Re: Death Match plugin
Reply With Quote #6

Quote:
Originally Posted by D4rkSiD3Rs View Post
PHP Code:
/* AMX Mod X script. 

* (c) Copyright 2002-2003, f117bomb 
* This file is provided as is (no warranties). 

*  *******************************************************************************
*   
*    Ported By KingPin( [email protected] ). I take no responsibility 
*    for this file in any way. Use at your own risk. No warranties of any kind. 
*
*  *******************************************************************************
*
* Set Cvar 'amx_respawn' 1 or 0 

*/ 

#include <amxmodx>
#include <fun>

new g_respawn

public TeamSelect(id)
{
    if(
get_cvar_num("amx_respawn") == 1)
    {
        new 
sId[2]
        
sId[0] = id
        set_task
(10.0,"respawn"0sId2)
    }
    return 
PLUGIN_CONTINUE
}

public 
death_msg() 
{
    if(
get_cvar_num("amx_respawn") == 1)
    { 
        new 
vIndex read_data(2
        new 
svIndex[2]
        
svIndex[0] = vIndex
        set_task
(0.5,"respawn"0svIndex2
    } 
    return 
PLUGIN_CONTINUE 
}

public 
respawn(svIndex[]) 

    new 
vIndex svIndex[0]

    if(
get_user_team(vIndex) == || is_user_alive(vIndex)) 
        return 
PLUGIN_CONTINUE

    spawn
(vIndex)
    
    return 
PLUGIN_CONTINUE
}

public 
dm_on()
{
    
set_pcvar_num(g_respawn1);
}

public 
dm_off()
{
    
set_pcvar_num(g_respawn0);
}

public 
plugin_init() 
{
       
register_plugin("amx_respawn","0.9.4","f117bomb")
    
register_event("DeathMsg","death_msg","a")
    
register_event("ShowMenu","TeamSelect","b","4&Team_Select")
    
register_event("VGUIMenu","TeamSelect","b","1=2")
    
g_respawn register_cvar("amx_respawn""0")
    
register_clcmd("say /dm1""dm_on")
    
register_clcmd("say /dm0""dm_off")

    return 
PLUGIN_CONTINUE

You can just pass task id as player id
Code:
set_task(0.5,"respawn", svIndex)
Will be more efficient
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-18-2018 , 08:29   Re: Death Match plugin
Reply With Quote #7

Quote:
Originally Posted by Ghosted View Post
You can just pass task id as player id
Code:
set_task(0.5,"respawn", svIndex)
Will be more efficient
It's not my plugin! see the author's name
D4rkSiD3Rs is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-18-2018 , 08:34   Re: Death Match plugin
Reply With Quote #8

Quote:
Originally Posted by farhanhyper View Post
Yes I heard but when I put that in the plugin It Doesnt work.
PHP Code:
#include<amxmodx>

public plugin_init()
{
    
register_plugin("Maps menu""1.0""");
    
register_clcmd("say /map""mapsmenu");
}

public 
mapsmenu(id)
{
    
client_cmd(id"amx_mapmenu");

D4rkSiD3Rs is offline
farhanhyper
Member
Join Date: Dec 2017
Location: Finland
Old 07-19-2018 , 01:55   Re: Death Match plugin
Reply With Quote #9

Quote:
Originally Posted by D4rkSiD3Rs View Post
PHP Code:
#include<amxmodx>

public plugin_init()
{
    
register_plugin("Maps menu""1.0""");
    
register_clcmd("say /map""mapsmenu");
}

public 
mapsmenu(id)
{
    
client_cmd(id"amx_mapmenu");

thank you so much
farhanhyper is offline
D4rkSiD3Rs
Senior Member
Join Date: Jan 2018
Location: Morocco
Old 07-19-2018 , 13:50   Re: Death Match plugin
Reply With Quote #10

Quote:
Originally Posted by farhanhyper View Post
thank you so much
Your welcome!
D4rkSiD3Rs is offline
Reply


Thread Tools
Display Modes

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 14:03.


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