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

[Help]Allow respawn only in infection mods


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-23-2016 , 20:23   [Help]Allow respawn only in infection mods
Reply With Quote #1

Hey all,

i want that when Player connect to the server then he has to be respawn into zombie not human
And only in infection rounds like : infection mod and Multi infection

i don't want that player connect and respawn in Nemesis Survivor Swarm and Plague.

So please help me
PHP Code:
#include <amxmodx>
#include <zombieplague>

#define validTeam(%1) (1 <= get_user_team(%1) <= 3)

new pcvarpcvar_nempcvar_plaguepcvar_survpcvar_swarm;

public 
plugin_init()
{
    
register_plugin("[ZP] Respawn""1.1""ILUSION");
    
pcvar get_cvar_pointer("zp_deathmatch");
    
pcvar_nem get_cvar_pointer("zp_nem_allow_respawn");
    
pcvar_plague get_cvar_pointer("zp_plague_allow_respawn");
    
pcvar_swarm get_cvar_pointer("zp_swarm_allow_respawn");
    
pcvar_surv get_cvar_pointer("zp_surv_allow_respawn");
}

public 
client_putinserver(id)
    if (
get_pcvar_num(pcvar))
        
set_task(5.0"SpawnUser"id__"b");

public 
SpawnUser(id)
{
    if (!
is_user_connected(id))
        
remove_task(id);
    else if (!
validTeam(id))
        return;
    else if (
is_user_alive(id) || zp_is_swarm_round() && !get_pcvar_num(pcvar_swarm) || zp_is_nemesis_round() && !get_pcvar_num(pcvar_nem) || zp_is_survivor_round() && !get_pcvar_num(pcvar_surv) || zp_is_plague_round() && !get_pcvar_num(pcvar_plague))
        
remove_task(id);
    else
    {
        switch (
get_pcvar_num(pcvar))
        {
            case 
1zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE ZP_TEAM_HUMAN);
            case 
2zp_respawn_user(idzp_is_nemesis_round() ? ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE);
            case 
3zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE zp_is_nemesis_round() ? ZP_TEAM_HUMAN random_num(12) == ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE);
            case 
4zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE zp_is_nemesis_round() ? ZP_TEAM_HUMAN zp_get_zombie_count() < zp_get_human_count() ? ZP_TEAM_ZOMBIE ZP_TEAM_HUMAN);
            default: 
zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE zp_is_nemesis_round() ? ZP_TEAM_HUMAN random_num(12) == ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE);
        }
        
        
remove_task(id);
    }

Please help me ASAP.
Thanks in Advance.
Hope you understand.
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-27-2016 , 06:50   Re: [Help]Allow respawn only in infection mods
Reply With Quote #2

Can anyone ?
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-27-2016 , 13:50   Re: [Help]Allow respawn only in infection mods
Reply With Quote #3

PHP Code:
switch(get_pcvar_num(pcvar))
{
           
// bla bla bla

Replace with:
PHP Code:
if(zp_get_infection_round())
{
          
zp_respawn_user(idZP_TEAM_ZOMBIE)

__________________
Depresie is offline
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-27-2016 , 16:36   Re: [Help]Allow respawn only in infection mods
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <zombieplague>

#define validTeam(%1) (1 <= get_user_team(%1) <= 3)

new pcvarpcvar_nempcvar_plaguepcvar_survpcvar_swarm;

public 
plugin_init()
{
    
register_plugin("[ZP] Respawn""1.1""ILUSION");
    
pcvar get_cvar_pointer("zp_deathmatch");
    
pcvar_nem get_cvar_pointer("zp_nem_allow_respawn");
    
pcvar_plague get_cvar_pointer("zp_plague_allow_respawn");
    
pcvar_swarm get_cvar_pointer("zp_swarm_allow_respawn");
    
pcvar_surv get_cvar_pointer("zp_surv_allow_respawn");
}

public 
client_putinserver(id)
    if (
get_pcvar_num(pcvar))
        
set_task(5.0"SpawnUser"id__"b");

public 
SpawnUser(id)
{
    if (!
is_user_connected(id))
        
remove_task(id);
    else if (!
validTeam(id))
        return;
    else if (
is_user_alive(id) || zp_is_swarm_round() && !get_pcvar_num(pcvar_swarm) || zp_is_nemesis_round() && !get_pcvar_num(pcvar_nem) || zp_is_survivor_round() && !get_pcvar_num(pcvar_surv) || zp_is_plague_round() && !get_pcvar_num(pcvar_plague))
        
remove_task(id);
    else
    {
        if(
zp_get_infection_round())
{
          
zp_respawn_user(idZP_TEAM_ZOMBIE)
}  
        
        
remove_task(id);
    }

PHP Code:
ErrorUndefined symbol "zp_get_infection_round" on line 32 
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Depresie
Veteran Member
Join Date: Nov 2013
Old 06-28-2016 , 02:55   Re: [Help]Allow respawn only in infection mods
Reply With Quote #5

PHP Code:
if(zp_get_survivor_round() || zp_get_nemesis_round() || zp_get_swarm_round() || zp_get_plague_round()) return;

zp_respawn_user(idZP_TEAM_ZOMBIE
__________________
Depresie is offline
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-30-2016 , 04:46   Re: [Help]Allow respawn only in infection mods
Reply With Quote #6

Can you please Copy my code and paste it in that all because i don't understand miniwords and in return i got error and repost
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-01-2016 , 03:26   Re: [Help]Allow respawn only in infection mods
Reply With Quote #7

Here

PHP Code:
public client_putinserver(id)
{
    
set_task(5.0"SpawnUser"id)
}

public 
SpawnUser(id)
{
    
// If user is not connected, stop here ( to avoid errors )
    
if(!is_user_connected(id)) return;
    
    
// If the game mode is any of this stop here ( to avoid respawning on other modes than infection )
    
if(zp_is_nemesis_round() || zp_is_survivor_round() || zp_is_plague_round() || zp_is_swarm_round()) return;
    
    
// If the player didn't select his team yet, we stop here ( to avoid errors and bugs )
    
if((cs_get_user_team(id) != CS_TEAM_CT) && (cs_get_user_team(id) != CS_TEAM_T))
    {
        
// We will check again in 5 seconds 
        
set_task(5.0"SpawnUser"id)
        return;
    }
    
    
zp_respawn_user(idZP_TEAM_ZOMBIE)
    

__________________

Last edited by Depresie; 07-01-2016 at 03:26.
Depresie is offline
Amine Belokda
Senior Member
Join Date: Oct 2015
Location: ML_NOT_FOUND
Old 07-08-2016 , 22:36   Re: [Help]Allow respawn only in infection mods
Reply With Quote #8

Quote:
Originally Posted by Kakarot47 View Post
Hey all,

i want that when Player connect to the server then he has to be respawn into zombie not human
And only in infection rounds like : infection mod and Multi infection

i don't want that player connect and respawn in Nemesis Survivor Swarm and Plague.

So please help me
PHP Code:
#include <amxmodx>
#include <zombieplague>

#define validTeam(%1) (1 <= get_user_team(%1) <= 3)

new pcvarpcvar_nempcvar_plaguepcvar_survpcvar_swarm;

public 
plugin_init()
{
    
register_plugin("[ZP] Respawn""1.1""ILUSION");
    
pcvar get_cvar_pointer("zp_deathmatch");
    
pcvar_nem get_cvar_pointer("zp_nem_allow_respawn");
    
pcvar_plague get_cvar_pointer("zp_plague_allow_respawn");
    
pcvar_swarm get_cvar_pointer("zp_swarm_allow_respawn");
    
pcvar_surv get_cvar_pointer("zp_surv_allow_respawn");
}

public 
client_putinserver(id)
    if (
get_pcvar_num(pcvar))
        
set_task(5.0"SpawnUser"id__"b");

public 
SpawnUser(id)
{
    if (!
is_user_connected(id))
        
remove_task(id);
    else if (!
validTeam(id))
        return;
    else if (
is_user_alive(id) || zp_is_swarm_round() && !get_pcvar_num(pcvar_swarm) || zp_is_nemesis_round() && !get_pcvar_num(pcvar_nem) || zp_is_survivor_round() && !get_pcvar_num(pcvar_surv) || zp_is_plague_round() && !get_pcvar_num(pcvar_plague))
        
remove_task(id);
    else
    {
        switch (
get_pcvar_num(pcvar))
        {
            case 
1zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE ZP_TEAM_HUMAN);
            case 
2zp_respawn_user(idzp_is_nemesis_round() ? ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE);
            case 
3zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE zp_is_nemesis_round() ? ZP_TEAM_HUMAN random_num(12) == ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE);
            case 
4zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE zp_is_nemesis_round() ? ZP_TEAM_HUMAN zp_get_zombie_count() < zp_get_human_count() ? ZP_TEAM_ZOMBIE ZP_TEAM_HUMAN);
            default: 
zp_respawn_user(idzp_is_survivor_round() ? ZP_TEAM_ZOMBIE zp_is_nemesis_round() ? ZP_TEAM_HUMAN random_num(12) == ZP_TEAM_HUMAN ZP_TEAM_ZOMBIE);
        }
        
        
remove_task(id);
    }

Please help me ASAP.
Thanks in Advance.
Hope you understand.
Respawn In :
Infection Round: ZPA 1.6.1 cmd: / zp_cfg.cfg = zp_infection_respawn 1
= Player Respawned Zombie In Infection Mod / round normal
__________________
Amine Belokda is offline
Send a message via MSN to Amine Belokda
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 17:51.


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