Raised This Month: $32 Target: $400
 8% 

Subplugin Submission [ZP] Addon: Respawn player on connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-02-2012 , 13:33   [ZP] Addon: Respawn player on connect
Reply With Quote #1

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).
Attached Files
File Type: sma Get Plugin or Get Source (zp_respawn.sma - 7865 views - 1.8 KB)
__________________

Last edited by ILUSION; 03-02-2012 at 19:03.
ILUSION is offline
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 03-02-2012 , 13:35   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #2

Great
gogicaa is offline
Nick Haldem
Senior Member
Join Date: Jun 2011
Location: Moldova
Old 03-02-2012 , 16:01   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #3

Nice one Also it will be good to make respawn in survivor round like zombie and in nemesis like human
Nick Haldem is offline
Send a message via Skype™ to Nick Haldem
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-02-2012 , 18:11   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #4

Quote:
Originally Posted by Nick Haldem View Post
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.
__________________
ILUSION is offline
Nick Haldem
Senior Member
Join Date: Jun 2011
Location: Moldova
Old 03-02-2012 , 18:51   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #5

I mean, for example in Nemesis round I will respawn like Zombie but I want like Human
Nick Haldem is offline
Send a message via Skype™ to Nick Haldem
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-02-2012 , 19:00   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #6

Quote:
Originally Posted by Nick Haldem View Post
I mean, for example in Nemesis round I will respawn like Zombie but I want like Human
Hahah ok! First post updated.
__________________
ILUSION is offline
Nick Haldem
Senior Member
Join Date: Jun 2011
Location: Moldova
Old 03-02-2012 , 19:09   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #7

Thanks, will test it.It will be usefull for many other members
Nick Haldem is offline
Send a message via Skype™ to Nick Haldem
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 03-03-2012 , 00:59   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #8

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;

__________________
naSTR is offline
Nick Haldem
Senior Member
Join Date: Jun 2011
Location: Moldova
Old 03-03-2012 , 05:15   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #9

This one is better.Mercylezz just respawn on connect.Ilussions's respawn only if it has written in your cfg
Nick Haldem is offline
Send a message via Skype™ to Nick Haldem
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 03-03-2012 , 09:29   Re: [ZP] Addon: Respawn player on connect
Reply With Quote #10

kay then i'm gonna use this. tnks ;)
__________________

Last edited by naSTR; 03-03-2012 at 09:29.
naSTR 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 23:11.


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