Raised This Month: $ Target: $400
 0% 

Respawn on connect Plugin Zp4.3


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bacau.AlphaCs.Ro
BANNED
Join Date: Dec 2012
Old 12-28-2012 , 16:02   Re: Respawn on connect Plugin Zp4.3
Reply With Quote #5

Can convert this for ZP4.3 ?

Code:
#include <amxmodx> 
#include <zombie_plague_advance> 

#define PLUGIN "ZP: AutoRespawn" 
#define VERSION "1.0.0" 
#define AUTHOR "yokomo" 

public plugin_init() 
{ 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
    register_event( "TeamInfo", "join_team", "a") 
} 

public join_team() 
{ 
    new id = read_data(1) 
    static user_team[32] 
     
    read_data(2, user_team, 31) 
     
    if(!is_user_connected(id)) 
        return 0; 
     
    switch(user_team[0]) 
    { 
        case 'C':   
        { 
            if(!is_user_alive(id)) 
            { 
                remove_task(id) 
                set_task(15.0,"SpawnPlayer",id); 
            } 
        }         
        case 'T': 
        {  
            if(!is_user_alive(id)) 
            { 
                remove_task(id) 
                set_task(15.0,"SpawnPlayer",id); 
            } 
        }     
        case 'S':   
        { 
            // No need to spawn player when he/she spectating 
            client_print(id, print_chat, "[ZP] You cannot respawn when in Spectator")     
        } 
    } 
    return 0; 
} 

public SpawnPlayer(id)  
{ 
    if(is_user_alive(id) || zp_is_assassin_round() || zp_is_sniper_round()) return 
     
    if ((zp_is_survivor_round() || zp_is_lnj_round() || zp_is_plague_round() || zp_is_swarm_round()) && (zp_get_human_count() > 1 || zp_get_zombie_count() > 1)) 
    { 
        // Spawn player as zombi on survivor, LNJ, plague, swarm round 
        zp_respawn_user (id, ZP_TEAM_ZOMBIE) 
        client_print(id, print_chat, "[ZP] You have been respawned as Zombie") 
    } 
    else if(zp_is_nemesis_round() && zp_get_human_count() > 1) 
    { 
        // Spawn player as human on nemesis round 
        zp_respawn_user (id, ZP_TEAM_HUMAN) 
        client_print(id, print_chat, "[ZP] You have been respawned as Human") 
    } 
    else 
    { 
        if(zp_get_human_count() > 1 && zp_get_zombie_count() > 1) 
        { 
            // Spawn player as zombi on infection round 
            zp_respawn_user (id, ZP_TEAM_ZOMBIE) 
            client_print(id, print_chat, "[ZP] You have been respawned as Zombie") 
        }     
    } 
} 

public zp_round_ended(id) remove_task(id) 
Bacau.AlphaCs.Ro is offline
 



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 13:37.


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