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

[REQ] ZP50 Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
z0mb1el0v3r
Senior Member
Join Date: May 2011
Old 10-04-2014 , 11:59   [REQ] ZP50 Respawn
Reply With Quote #1

Hello again. Can someone make a plugin that respawns a human or zombie player in zombies team whenever they are dead in both Infection and Swarm mode only? Also, make them respawnable only twice in a round. And for zp50 too.


Thank you in advance yaw.
z0mb1el0v3r is offline
Nax0ne
Senior Member
Join Date: Jul 2011
Location: Chile
Old 10-05-2014 , 00:15   Re: [REQ] ZP50 Respawn
Reply With Quote #2

Simple. Use deathmatch mode. Sets the cvars in zombieplague.cfg
__________________

Last edited by Nax0ne; 10-05-2014 at 00:15.
Nax0ne is offline
z0mb1el0v3r
Senior Member
Join Date: May 2011
Old 10-05-2014 , 06:00   Re: [REQ] ZP50 Respawn
Reply With Quote #3

Quote:
Originally Posted by Nax0ne View Post
Simple. Use deathmatch mode. Sets the cvars in zombieplague.cfg
Except, zp50 deathmatch works for all gamemodes(gameplay will suck if deathmatch is enabled in nemesis, survivor, plague and armageddon mode). I want it to work on Infection and Swarm mode only. Also zp50 deathmatch doesn't have respawn count cvar which makes the respawn unlimited. I want each player can respawn twice only in a single round.

Last edited by z0mb1el0v3r; 10-05-2014 at 06:04.
z0mb1el0v3r is offline
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 10-06-2014 , 02:19   Re: [REQ] ZP50 Respawn
Reply With Quote #4

Quote:
Originally Posted by z0mb1el0v3r View Post
Except, zp50 deathmatch works for all gamemodes(gameplay will suck if deathmatch is enabled in nemesis, survivor, plague and armageddon mode). I want it to work on Infection and Swarm mode only. Also zp50 deathmatch doesn't have respawn count cvar which makes the respawn unlimited. I want each player can respawn twice only in a single round.
by using zp 5.0.8a you will be have a option to add Deathmatch On Infection mod !

and next you can manage your Death match's on zombie plague.cfg

ignore dm on survivor
ignore dm on nemesis
ignore dm on assassin

and .....
__________________
the city is no fun
there is no sun
and its so dark
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 10-06-2014 , 03:24   Re: [REQ] ZP50 Respawn
Reply With Quote #5

Replace your zp50_deathmatch with this and try..

PHP Code:
/*================================================================================
    
    -----------------------
    -*- [ZP] Deathmatch -*-
    -----------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <cs_ham_bots_api>
#include <zp50_gamemodes>

#define TASK_RESPAWN 100
#define ID_RESPAWN (taskid - TASK_RESPAWN)

// Custom Forwards
enum _:TOTAL_FORWARDS
{
    
FW_USER_RESPAWN_PRE 0
}
new 
g_Forwards[TOTAL_FORWARDS]
new 
g_ForwardResult

new g_MaxPlayers
new g_GameModeStarted

new cvar_deathmatchcvar_respawn_delay
new cvar_respawn_zombiescvar_respawn_humans
new cvar_respawn_on_suicide

new g_GameModeSwarmIDg_GameModeInfectionIDg_GameModeMultiID 

public plugin_init()
{
    
register_plugin("[ZP] Deathmatch"ZP_VERSION_STRING"ZP Dev Team")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHamBots(Ham_Spawn"fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
    
RegisterHamBots(Ham_Killed"fw_PlayerKilled_Post"1)
    
    
cvar_deathmatch register_cvar("zp_deathmatch""0")
    
cvar_respawn_delay register_cvar("zp_respawn_delay""5")
    
cvar_respawn_zombies register_cvar("zp_respawn_zombies""1")
    
cvar_respawn_humans register_cvar("zp_respawn_humans""1")
    
cvar_respawn_on_suicide register_cvar("zp_respawn_on_suicide""0")
    
    
g_MaxPlayers get_maxplayers()
    
    
g_Forwards[FW_USER_RESPAWN_PRE] = CreateMultiForward("zp_fw_deathmatch_respawn_pre"ET_CONTINUEFP_CELL)
}

public 
plugin_cfg()  
{    
    
g_GameModeSwarmID zp_gamemodes_get_id("Swarm Mode"
    
g_GameModeInfectionID zp_gamemodes_get_id("Infection Mode")
    
g_GameModeMultiID zp_gamemodes_get_id("Multiple Infection Mode")  
}  

// Ham Player Spawn Post Forward
public fw_PlayerSpawn_Post(id)
{
    
// Not alive or didn't join a team yet
    
if (!is_user_alive(id) || !cs_get_user_team(id))
        return;
    
    
// Remove respawn task
    
remove_task(id+TASK_RESPAWN)
}

// Ham Player Killed Post Forward
public fw_PlayerKilled_Post(victimattackershouldgib)
{
    
// Respawn if deathmatch is enabled
    
if (get_pcvar_num(cvar_deathmatch))
    {
                
// Respawn on suicide?
        
if (!get_pcvar_num(cvar_respawn_on_suicide) && (victim == attacker || !is_user_connected(attacker)))
            return;
        
        
// Respawn if human/zombie?
        
if ((zp_core_is_zombie(victim) && !get_pcvar_num(cvar_respawn_zombies)) || (!zp_core_is_zombie(victim) && !get_pcvar_num(cvar_respawn_humans)))
            return;

                if(
zp_gamemodes_get_current() == g_GameModeInfectionID || zp_gamemodes_get_current() == g_GameModeMultiID || zp_gamemodes_get_current() == g_GameModeSwarmID
                { 
                    
// Set the respawn task
                  
set_task(get_pcvar_float(cvar_respawn_delay), "respawn_player_task"victim+TASK_RESPAWN)
                } 
    }
}

// Respawn Player Task (deathmatch)
public respawn_player_task(taskid)
{
    
// Already alive or round ended
    
if (is_user_alive(ID_RESPAWN) || zp_gamemodes_get_current() == ZP_NO_GAME_MODE)
        return;
    
    
// Get player's team
    
new CsTeams:team cs_get_user_team(ID_RESPAWN)
    
    
// Player moved to spectators
    
if (team == CS_TEAM_SPECTATOR || team == CS_TEAM_UNASSIGNED)
        return;
    
    
// Allow other plugins to decide whether player can respawn or not
    
ExecuteForward(g_Forwards[FW_USER_RESPAWN_PRE], g_ForwardResultID_RESPAWN)
    if (
g_ForwardResult >= PLUGIN_HANDLED)
        return;
    
    
// Respawn as zombie?
    
if (get_pcvar_num(cvar_deathmatch) == || (get_pcvar_num(cvar_deathmatch) == && random_num(01)) || (get_pcvar_num(cvar_deathmatch) == && zp_core_get_zombie_count() < GetAliveCount()/2))
    {
        
// Only allow respawning as zombie after a game mode started
        
if (g_GameModeStartedzp_core_respawn_as_zombie(ID_RESPAWNtrue)
    }
    
    
respawn_player_manually(ID_RESPAWN)
}

// Respawn Player Manually (called after respawn checks are done)
respawn_player_manually(id)
{
    
// Respawn!
    
ExecuteHamB(Ham_CS_RoundRespawnid)
}

public 
client_disconnect(id)
{
    
// Remove tasks on disconnect
    
remove_task(id+TASK_RESPAWN)
}

public 
zp_fw_gamemodes_start()
{
    
g_GameModeStarted true
}

public 
zp_fw_gamemodes_end()
{
    
g_GameModeStarted false
    
    
// Stop respawning after game mode ends
    
new id
    
for (id 1id <= g_MaxPlayersid++)
        
remove_task(id+TASK_RESPAWN)
}

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

or this (another plugin and disable zp normal respawn to work properly):

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zp50_core>
#include <hamsandwich>
#include <cs_ham_bots_api>
#include <zp50_gamemodes>

#define PLUGIN "[ZP50] Addon: C.A.T Respawn System"
#define VERSION "1.1"
#define AUTHOR "Catastrophe"

new crs_starting_livescrs_resp_delay
new lives[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
        
register_cvar("CAT_RESP","1",(FCVAR_SERVER|FCVAR_SPONLY))
    
    
register_event("HLTV""event_newround""a""1=0""2=0"
    
    
RegisterHam(Ham_Killed"player""fw_killed")
    
RegisterHamBots(Ham_Killed"fw_killed"
    
    
crs_starting_lives register_cvar("crs_starting_lives""2"
    
crs_resp_delay register_cvar("crs_resp_delay""5.0"
    
}

public 
event_newround()
{
       for(new 
1get_maxplayers(); i++)
       {
       
         if(
is_user_connected(i))
     {
     
lives[i] = -1
         

    
       }
    
}

public 
zp_fw_core_cure_post(idattacker)
{
       
lives[id] = -1
}

public 
zp_fw_core_infect_post(idattacker)
{

       if(
zp_gamemodes_get_current() == zp_gamemodes_get_id("Nemesis Mode")
       || 
zp_gamemodes_get_current() == zp_gamemodes_get_id("Survivor Mode")
       || 
zp_gamemodes_get_current() == zp_gamemodes_get_id("Plague Mode")
       || 
zp_gamemodes_get_current() == zp_gamemodes_get_id("Armageddon Mode"))
         return;

       if(
lives[id] == -1)
       {
         
lives[attacker] += get_pcvar_num(crs_starting_lives)      
       }
}


public 
fw_killed(victimattackershouldgib)
{
       if (
is_user_connected(victim) &&  lives[victim] > && zp_core_is_zombie(victim))
       {
           
       
lives[victim] -= 1     
       set_task
(get_pcvar_float(crs_resp_delay), "respawn"victim)
    
       }
}


public 
respawn(id)
{

   if(
zp_gamemodes_get_current() == zp_gamemodes_get_id("Nemesis Mode")
   || 
zp_gamemodes_get_current() == zp_gamemodes_get_id("Survivor Mode")
   || 
zp_gamemodes_get_current() == zp_gamemodes_get_id("Plague Mode")
   || 
zp_gamemodes_get_current() == zp_gamemodes_get_id("Armageddon Mode"))
      return;
    
   if(
is_user_connected(id))
   {
        if(
get_user_team(id) == || get_user_team(id) == 3
        return;
    
        
zp_core_respawn_as_zombie(idtrue)
        
ExecuteHamB(Ham_CS_RoundRespawnid)
 
   }
   


Last edited by wicho; 10-06-2014 at 04:18.
wicho is offline
z0mb1el0v3r
Senior Member
Join Date: May 2011
Old 10-06-2014 , 16:37   Re: [REQ] ZP50 Respawn
Reply With Quote #6

@cr0w
Oh right, I forgot there are cvar to enable/disable DM on each game modes part... I only make a quick check on Deathmatch section last time in zombieplague.cfg before I make this thread. It's been a while since I last configure ZP.

@wicho
Thanks yo. Actually I managed to make my own already

Solved.

Last edited by z0mb1el0v3r; 10-06-2014 at 16:41. Reason: Solved
z0mb1el0v3r is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 10-06-2014 , 18:20   Re: [REQ] ZP50 Respawn
Reply With Quote #7

Post the code so u can help another people..
wicho 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 00:52.


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