AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   Armageddon mode respawn (https://forums.alliedmods.net/showthread.php?t=233126)

Korasnr 01-10-2014 07:23

Armageddon mode respawn
 
1 Attachment(s)
Hello :) I have Zombie Plague 5.0.8 :) My problem is, when i play "armagedon MOD players" is 50/50 nemesis and survivor. This is good. But when i kill nemesis or survivor, death player respawn in to normal human or zombie i want respawn when i kill player, he is respawn back in to survivor or nemesis

And Snipers vs Assasin too

THX for help :)

SRY my bad english :)

wicho 01-11-2014 01:46

Re: Armageddon mode respawn
 
Try..

PHP Code:

#include <amxmodx>  
#include <hamsandwich>  
#include <zp50_core>  
#include <zp50_gamemodes>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>  

#define PLUGIN   "Respawn on armageddon"  
#define AUTHOR        "who cares"  
#define VERSION         "1.0"  

#define TASK_AUTORESPAWN  100  
#define ID_AUTORESPAWN (taskid - TASK_AUTORESPAWN)  

const Float:AUTORESPAWN_DELAY 5.0  

new g_GameModeArmageddonID
     
new g_CvarDeathMatch 
new g_MaxPlayers  

public plugin_init() 
{  
    
register_plugin(PLUGINVERSIONAUTHOR)  
            
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
           
    
g_MaxPlayers get_maxplayers()  
}  

public 
plugin_cfg()  
{   
    
g_GameModeArmageddonID zp_gamemodes_get_id("Armageddon Mode")
    
g_CvarDeathMatch get_cvar_pointer("zp_deathmatch"
}  

public 
fw_PlayerKilled(victimattackershouldgib)
{  
    if (!
get_pcvar_num(g_CvarDeathMatch))  
        return;  
              
    if(
zp_gamemodes_get_current() == g_GameModeArmageddonID
    { 
            
set_task(AUTORESPAWN_DELAY"auto_respawn_player"victim+TASK_AUTORESPAWN)          
    }           
     
}  

public 
auto_respawn_player(taskid)  
{  
    if(
is_user_alive(ID_AUTORESPAWN))
            return;  
                
    if(
get_pcvar_num(g_CvarDeathMatch) == || (get_pcvar_num(g_CvarDeathMatch) == && random_num(01)) || (get_pcvar_num(g_CvarDeathMatch) == && zp_core_get_zombie_count() < fnGetAlive()/2))  
    {  
        
zp_class_nemesis_set(ID_AUTORESPAWN)  
    }   
     
    else  
    
    {  
        
zp_class_survivor_set(ID_AUTORESPAWN)  
    }  
     
    
ExecuteHamB(Ham_CS_RoundRespawnID_AUTORESPAWN)  
}  

fnGetAlive() 
{  
    new 
iAliveid  
      
    
for (id 1id <= g_MaxPlayersid++) 
    {  
        if (
is_user_alive(id))  
            
iAlive++  
    }  
    return 
iAlive;  


edited..

Catastrophe 01-11-2014 03:08

Re: Armageddon mode respawn
 
Wicho's code will respawn everybody as nemesis and survivor i think and that too it will be called only when a player connects to the server... Use this code and tell me if u have any problems... not tested :-

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_gamemodes>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>  


#define PLUGIN "Armageddon Mode Special respawn"
#define VERSION "1.0"
#define AUTHOR "Catastrophe"

#define RESP_DELAY 5.0


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""fw_Killed")
}

public 
fw_Killed(victimattackershouldgib)
{
         if(!
is_user_alive(attacker) || zp_gamemodes_get_current() != zp_gamemodes_get_id("Armageddon Mode"))
         return
    
         if(
zp_class_survivor_get(victim))
         {
         
set_task(RESP_DELAY"do_resp1"victim)
         }
    
         if(
zp_class_nemesis_get(victim))
         {
         
set_task(RESP_DELAY"do_resp2"victim)
         }
}

public 
do_resp1(id)
{
        if(!
is_user_connected(id))
        return
    
        
ExecuteHam(Ham_CS_RoundRespawnid
        
zp_class_survivor_set(id)
         
}

public 
do_resp2(id)
{
        if(!
is_user_connected(id))
        return
    
        
ExecuteHam(Ham_CS_RoundRespawnid
        
zp_class_nemesis_set(id)
         



Korasnr 01-11-2014 06:54

Re: Armageddon mode respawn
 
Not working

xxwantedxx 01-11-2014 08:32

Re: Armageddon mode respawn
 
u can change it in zombieplague.cfg

Catastrophe 01-11-2014 09:55

Re: Armageddon mode respawn
 
Did u check the console for any errors or stuff ? did it give u any compile errors ? Are there any other side effects like instead of 1 guy every1 respawns as nemesis .....

And the MOST IMPORTANT THING, set the value of RESP_DELAY in the code less than the respawn time u have set in zombieplague.cfg

Korasnr 01-11-2014 11:45

Re: Armageddon mode respawn
 
Quote:

Originally Posted by Catastrophe (Post 2084430)
Did u check the console for any errors or stuff ? did it give u any compile errors ? Are there any other side effects like instead of 1 guy every1 respawns as nemesis .....

And the MOST IMPORTANT THING, set the value of RESP_DELAY in the code less than the respawn time u have set in zombieplague.cfg


Sma is good not problem. Problem is when i add plugin in plugins.ini and restart server and join in server, "Armagedon mod" miss in the admin menu, i cant use mod...

xxwantedxx 01-11-2014 15:40

Re: Armageddon mode respawn
 
try custom game modes plugin, or download mine plugin and then edit delay, as i sad u must check zombieplague.cfg and set delay and find ljn mode and the. set delay again. it must work

Catastrophe 01-12-2014 03:10

Re: Armageddon mode respawn
 
Dude .... dont just use the sma i gave u.... use the game mode... the one u gave and the script that i gave....
Cant believe how inexperienced people can server owners be (No offense)

That mean use thisp and also use this


All times are GMT -4. The time now is 12:11.

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