Raised This Month: $ Target: $400
 0% 

Simple Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-25-2009 , 19:55   Re: Simple Respawn
Reply With Quote #21

Quote:
Originally Posted by Dores View Post
If you don't want round end just use round end blocker plugins in the forums.
Best one is here :
http://amxmodx.ucoz.ru/load/4-1-0-16
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
CuLLi
BANNED
Join Date: Apr 2009
Location: Romania (piratebay) C
Old 04-26-2009 , 06:02   Re: Simple Respawn
Reply With Quote #22

thx! its works. And is nice cuz i made to see the rules in the spectators names.
CuLLi is offline
CuLLi
BANNED
Join Date: Apr 2009
Location: Romania (piratebay) C
Old 04-26-2009 , 10:15   Re: Simple Respawn
Reply With Quote #23

i find this respawn. is nice cuz respawn you fast(not ultra fast) after you dead but i dont like when you are enjoying a team cuz you must wait 10 seconds to be spawnned

can somebody edit this to be the first spawn faster??

PHP Code:
/* AMX Mod X script. 

* (c) Copyright 2002-2003, f117bomb 

*  *******************************************************************************
*   
*    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. 
*
*  *******************************************************************************
* 0.94 Version f117 bomb
* 0.94Evo (not official) Add command amx_auto-respawn and a file of translations "amx_respawn.txt".
*
* Command:
* amx_auto-respawn <1|0> - Enable/Disable the auto-respawn mod

* You need the ADMIN_LEVEL_E flag, you can change this acces with below:
*
* The cvar always exist too: "amx_respawn" <1|0> but it's advised to use the command
*
* Compiled with AMX 2006.3
*
* Setup:
*
* Install the amx file.
* Enable fun (if it is'nt already actived).
* Put the "amx_respawn.amx" file in the addons/amx/plugins folder.
* Put the "amx_respawn.txt" file in the addons/amx/lang folder.
* The ".sma" file is the source of plugin, you can put this file in addons/amx/examples folder.
*
*/ 

#include <amxmod>
#include <fun>

#define FLAG_AMX_RESPAWN        ADMIN_LEVEL_E    // ADMIN flag

public TeamSelect(id)
{
    if (
get_cvar_num("amx_respawn") == 1)
    {
        new 
sId[2]
        
sId[0] = id
        set_task
(10.0,"respawn",0,sId,2)
    }
    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.3,"respawn",0,svIndex,2
    }
    
    return 
PLUGIN_CONTINUE
    


public 
respawn(svIndex[]) 

    new 
vIndex svIndex[0
    if(
get_user_team(vIndex) == || is_user_alive(vIndex)) 
        return 
PLUGIN_CONTINUE 
    user_spawn
(vIndex
    
    return 
PLUGIN_CONTINUE    


public 
auto_rs(id)    // flat 6
{
    if (!(
get_user_flags(id)&FLAG_AMX_RESPAWN))
    {
        
client_print(idprint_chat, ("[AMX] You have no access to that command."))    // No access
        
console_print(id, ("[AMX] You have no access to that command."))    // No access
        
return PLUGIN_HANDLED
    
}
    
    new 
Bits[4], bit
    
    read_argv
(1Bits4)
    
bit str_to_num(Bits)
    
    if (!
strlen(Bits))
    {
        
console_print(id, ("[AMX] Usage: amx_auto-respawn <1|0> (1=Enable|0=Disable)"))    // Usage
        
return PLUGIN_HANDLED
    
}
    
    if (
bit == 0)    
        {
        
set_cvar_num("amx_respawn",0)
        
client_print(0,print_chat,("[AMX] ^x04Auto-respawn dezactivat."))    // All players can see the msg
        
return PLUGIN_HANDLED
    
}
    
    if (
bit ==1)
    {
        
set_cvar_num("amx_respawn",1)
        
client_print(0,print_chat,("[AMX] ^x04Auto-respawn activat."))    // All players can see the msg
        
return PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
plugin_init() 

       
register_plugin(("AMX Respawn"),"0.94Evo","f117bomb"
       
register_concmd("amx_auto-respawn","auto_rs",FLAG_AMX_RESPAWN,("<1|0> - Enable/Disable the auto-respawn mod"))    // Command add by flat 6
       
       
register_cvar("amx_respawn","0"// Cvar
       
       
register_event("DeathMsg","death_msg","a"
    
register_event("ShowMenu","TeamSelect","b","4&Team_Select")
    
register_event("VGUIMenu","TeamSelect","b","1=2")
    
    return 
PLUGIN_CONTINUE 

CuLLi is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-26-2009 , 10:17   Re: Simple Respawn
Reply With Quote #24

set_task(10.0,"respawn",0,sId,2) <= change 10 by what you want.
Arkshine is offline
stylerro
Senior Member
Join Date: Mar 2007
Old 05-12-2009 , 10:49   Re: Simple Respawn
Reply With Quote #25

PHP Code:
#include <amxmodx>
#include <hamsandwich>
 
#define RESPAWN_DELAY 2.0
 
new g_RespawnSound[] = "misc/respawn.wav";
 
public 
plugin_precache()
precache_sound(g_RespawnSound);
 
public 
plugin_init()
RegisterHam(Ham_Killed"player""PlayerKilled"1);
 
public 
PlayerKilled(Victim)
if (!
is_user_alive(Victim))
set_task(RESPAWN_DELAY"PlayerRespawn"Victim);
 
public 
PlayerRespawn(Client)
if (!
is_user_alive(Client))
{
remove_task(Client);
ExecuteHamB(Ham_CS_RoundRespawnClient);
client_cmd(Client"spk %s"g_RespawnSound);

can u make respawn only with knife?
stylerro is offline
Old 05-12-2009, 12:19
csl
This message has been deleted by csl. Reason: sry
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-12-2009 , 12:38   Re: Simple Respawn
Reply With Quote #26

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
 
#define RESPAWN_DELAY 2.0
 
new g_RespawnSound[] = "misc/respawn.wav";
new 
bool:Alive[33];
 
public 
plugin_precache()
    
precache_sound(g_RespawnSound);
 
public 
plugin_init()
{
    
RegisterHam(Ham_Killed"player""PlayerKilled"1);
    
RegisterHam(Ham_Spawn"player""PlayerSpawned"1);
}

public 
PlayerSpawned(Client)
    
Alive[Client] = bool:is_user_alive(Client);
 
public 
PlayerKilled(Victim)
    if ( !(
Alive[Victim] = bool:is_user_alive(Victim)) )
        
set_task(RESPAWN_DELAY"PlayerRespawn"Victim);

public 
PlayerRespawn(Client)
{
    if (!
Alive[Client])
    {
        
ExecuteHamB(Ham_CS_RoundRespawnClient);
        
client_cmd(Client"spk %s"g_RespawnSound);
        
set_task(0.2"PostPlayerRespawn"Client);
    }
}

public 
PostPlayerRespawn(Client)
{
    if (
Alive[Client])
    {
        
strip_user_weapons(Client);
        
give_item(Client"weapon_knife");
    }
}

public 
client_disconnect(Client)
      
Alive[Client] = false
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
stylerro
Senior Member
Join Date: Mar 2007
Old 05-12-2009 , 16:06   Re: Simple Respawn
Reply With Quote #27

ty man +k.
stylerro is offline
stylerro
Senior Member
Join Date: Mar 2007
Old 05-13-2009 , 09:25   Re: Simple Respawn
Reply With Quote #28

one more suggestion: add a way to read spawns.cfg from CSDM folder; for random spawns like in gungame.
stylerro is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 05-14-2009 , 06:05   Re: Simple Respawn
Reply With Quote #29

hi everyone i have a little quetion about using "PostPlayerSpawn"
i realy dont get it why it's used.
maybe someone can explain me
because i want to understand and use it correct !!!

whats wrong to strip or give items on PlayerSpawn ???
like this example:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>

#define RESPAWN_DELAY 2.0

new g_RespawnSound[] = "misc/respawn.wav";
new 
is_plr_alive[33];

public 
plugin_precache()
    
precache_sound(g_RespawnSound);

public 
plugin_init()
{
    
RegisterHam(Ham_Killed"player""PlayerKilled"1);
    
RegisterHam(Ham_Spawn"player""PlayerSpawned"1);
}

public 
PlayerSpawned(Client)
{
    if (!
is_user_alive(Client) && !cs_get_user_team(Client))
        return
    
    
is_plr_alive[Client] = true
    
    strip_user_weapons
(Client);
    
give_item(Client"weapon_knife");
}

public 
PlayerKilled(Victim)
{
    
is_plr_alive[Victim] = false
    set_task
(RESPAWN_DELAY"PlayerRespawn"Victim);
}

public 
PlayerRespawn(Client)
{
    
ExecuteHamB(Ham_CS_RoundRespawnClient);
    
//client_cmd(Client, "spk %s", g_RespawnSound);
}

public 
client_disconnect(Client)
    
is_plr_alive[Client] = false 
__________________

Last edited by vato loco [GE-S]; 05-14-2009 at 10:48.
vato loco [GE-S] is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 05-14-2009 , 07:11   Re: Simple Respawn
Reply With Quote #30

I just used it to make sure the player respawned without problems, your code should work fine too.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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 07:55.


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