AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Subplugin Submission [ZP] Addon: Respawn player on connect (https://forums.alliedmods.net/showthread.php?t=179546)

ILUSION 03-02-2012 13:33

[ZP] Addon: Respawn player on connect
 
2 Attachment(s)
Hi, this simple plugin allow users to respawn after connect depending zp_deathmatch value.

If is a special round and that round doesn't allow user respawn... the user doesn't spawn.

Code:

zp_deathmatch 0: Plugin disabled
zp_deathmatch 1: Human
zp_deathmatch 2: Zombie
zp_deathmatch 3: Randomly
zp_deathmatch 4: Balanced

Changelog:
Code:

v1.0: First public release.
v1.1: Added support for nemesis (respawn as human) / survivor rounds (respawn as zombie).


gogicaa 03-02-2012 13:35

Re: [ZP] Addon: Respawn player on connect
 
Great :)

Nick Haldem 03-02-2012 16:01

Re: [ZP] Addon: Respawn player on connect
 
Nice one :) Also it will be good to make respawn in survivor round like zombie and in nemesis like human

ILUSION 03-02-2012 18:11

Re: [ZP] Addon: Respawn player on connect
 
Quote:

Originally Posted by Nick Haldem (Post 1661193)
Nice one :) Also it will be good to make respawn in survivor round like zombie and in nemesis like human

Set zp_surv_allow_respawn 1 and zp_nem_allow_respawn 1 and you will respawn.

Nick Haldem 03-02-2012 18:51

Re: [ZP] Addon: Respawn player on connect
 
I mean, for example in Nemesis round I will respawn like Zombie but I want like Human

ILUSION 03-02-2012 19:00

Re: [ZP] Addon: Respawn player on connect
 
Quote:

Originally Posted by Nick Haldem (Post 1661315)
I mean, for example in Nemesis round I will respawn like Zombie but I want like Human

Hahah ok! First post updated.

Nick Haldem 03-02-2012 19:09

Re: [ZP] Addon: Respawn player on connect
 
Thanks, will test it.It will be usefull for many other members :)

naSTR 03-03-2012 00:59

Re: [ZP] Addon: Respawn player on connect
 
Im using MeRcyLeZZ's script. Which one is better, you think?

PHP Code:

// todo:
// check cvar values for zp_respawn_after_last_human, zp_infection_allow_respawn, zp_nem_allow_respawn, etc.

#include <amxmodx>
#include <zombieplague>

const Float:AUTORESPAWN_DELAY 5.0
const TASK_AUTORESPAWN 100
#define ID_AUTORESPAWN (taskid - TASK_AUTORESPAWN)
new cvar_deathmatchg_maxplayers

public plugin_init()
{
    
register_plugin("[ZP] Addon: Respawn Player""0.1""MeRcyLeZZ")
    
register_clcmd("joinclass","cmd_joinclass"); // new menus
    
register_menucmd(register_menuid("Terrorist_Select",1),511,"cmd_joinclass"); // old menus
    
register_menucmd(register_menuid("CT_Select",1),511,"cmd_joinclass"); // old menus
    
cvar_deathmatch get_cvar_pointer("zp_deathmatch")
    
g_maxplayers get_maxplayers()
}

// Player selects model
public cmd_joinclass(id)
{
    if (!
get_pcvar_num(cvar_deathmatch))
        return;
    
    
set_task(AUTORESPAWN_DELAY"auto_respawn_player"id+TASK_AUTORESPAWN)
}

public 
client_disconnect(id)
{
    
remove_task(id+TASK_AUTORESPAWN)
}

public 
auto_respawn_player(taskid)
{
    
// Already alive?
    
if (is_user_alive(ID_AUTORESPAWN))
        return;
    
    
// Nemesis/Survivor round overrides
    
if (zp_is_survivor_round())
    {
        
zp_respawn_user(ID_AUTORESPAWNZP_TEAM_ZOMBIE)
        return;
    }
    if (
zp_is_nemesis_round())
    {
        
zp_respawn_user(ID_AUTORESPAWNZP_TEAM_HUMAN)
        return;
    }
    
    
// Respawn as zombie?
    
if (get_pcvar_num(cvar_deathmatch) == || (get_pcvar_num(cvar_deathmatch) == && random_num(01)) || (get_pcvar_num(cvar_deathmatch) == && zp_get_zombie_count() < fnGetAlive()/2))
        
zp_respawn_user(ID_AUTORESPAWNZP_TEAM_ZOMBIE)
    else
        
zp_respawn_user(ID_AUTORESPAWNZP_TEAM_HUMAN)
}

// Get Alive -returns alive players number-
fnGetAlive()
{
    new 
iAliveid
    
    
for (id 1id <= g_maxplayersid++)
    {
        if (
is_user_alive(id))
            
iAlive++
    }
    
    return 
iAlive;



Nick Haldem 03-03-2012 05:15

Re: [ZP] Addon: Respawn player on connect
 
This one is better.Mercylezz just respawn on connect.Ilussions's respawn only if it has written in your cfg

naSTR 03-03-2012 09:29

Re: [ZP] Addon: Respawn player on connect
 
kay then i'm gonna use this. tnks ;)


All times are GMT -4. The time now is 13:58.

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