Zplague
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Zplague Entrar

Seu portal de Zombie Plague no Brasil


description[ZP 5.0] zp50_respawn_on_connect Empty[ZP 5.0] zp50_respawn_on_connect

more_horiz
Eu baixei o plugin na NET, so que não ta pegando
Função do Plugin: renascer player de zm nos mods infection e multiple infection apenas quando connectar-se ao servidor (para evitar ficar renascendo os retry)

zp50_respawn_on_connect.sma

Código:


#include <  amxmodx >
#include <  hamsandwich >
#include <  zp50_core >
#include <  zp50_gamemodes >
#include <  zp50_random_spawn >

new const PLUGIN_VERSION[] = "1.0.0"

#define RESPAWN_AS_ZOMBIE    true
#define USE_CSDM_SPAWNS    false

#define TASK_RESPAWN    65639

new CvarRespawnDelay

new g_bsJustConnected;
new g_szGamemode1, g_szGamemode2

new g_iCurrentModeID

public plugin_init()
{
    register_plugin("[ZP] Addon: Respawn on connect", PLUGIN_VERSION, "Excalibur.007")
   
    register_clcmd( "jointeam", "_JoinTeam_" );
    register_clcmd( "chooseteam", "_JoinTeam_" );
   
    CvarRespawnDelay = register_cvar("zp_respawn_delay_on_connect", "3.0")
   
    g_szGamemode1 = zp_gamemodes_get_id("Infection Mode")
    g_szGamemode2 = zp_gamemodes_get_id("Multiple Infection Mode")
}   

public client_putinserver(player)
{
    g_iCurrentModeID = zp_gamemodes_get_current()
   
    if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
    {
        g_bsJustConnected |= ( 1 << player );
    }
}

public client_disconnect(player)
{
    g_bsJustConnected &= ~( 1 << player );
    remove_task(player+TASK_RESPAWN)
}

public _JoinTeam_(player)
{
    if (~g_bsJustConnected & (1<<player))
        return;
   
    new team = get_user_team(player);
   
    if (team == 0 || team == 3)
        return;   
       
    g_bsJustConnected &= ~(1<<player);
    set_task(get_pcvar_float(CvarRespawnDelay), "RespawnPlayer", player+TASK_RESPAWN);
}

public RespawnPlayer(taskid)
{
    g_iCurrentModeID = zp_gamemodes_get_current()
   
    if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
    {
        static player
        player = (taskid - TASK_RESPAWN)
       
        new team = get_user_team(player);

        if(is_user_alive(player) || team == 0 || team == 3 )
            return
       
        zp_core_respawn_as_zombie(player, RESPAWN_AS_ZOMBIE)
       
        ExecuteHamB(Ham_Spawn, player)
       
        zp_random_spawn_do(player, USE_CSDM_SPAWNS)
    }
}


Última edição por guh._.rds em 30/4/2012, 5:38 pm, editado 1 vez(es)

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
tem como botar as includes que faltaram ?
e envie como code e não spoiler

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
#include < amxmodx >
#include < hamsandwich >
#include < zp50_core >
#include < zp50_gamemodes >
#include < zp50_random_spawn >

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
Testa ai manolo : )

Código:


    #include <  amxmodx >
    #include <  hamsandwich >
    #include <  zp50_core >
    #include <  zp50_gamemodes >
    #include <  zp50_random_spawn >

    new const PLUGIN_VERSION[] = "1.0.0"

    #define RESPAWN_AS_ZOMBIE    true
    #define USE_CSDM_SPAWNS    false

    #define TASK_RESPAWN    65639

    new CvarRespawnDelay

    new g_bsJustConnected;
    new g_szGamemode1, g_szGamemode2

    new g_iCurrentModeID

    public plugin_init()
    {
        register_plugin("[ZP] Addon: Respawn on connect", PLUGIN_VERSION, "Excalibur.007")
             
        CvarRespawnDelay = register_cvar("zp_respawn_delay_on_connect", "3.0")
     
        g_szGamemode1 = zp_gamemodes_get_id("Infection Mode")
        g_szGamemode2 = zp_gamemodes_get_id("Multiple Infection Mode")
    } 

public client_putinserver(player)
{
   g_iCurrentModeID = zp_gamemodes_get_current()
   
   if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
   {
      g_bsJustConnected |= ( 1 << player );
      set_task(get_pcvar_float(CvarRespawnDelay), "RespawnPlayer", player+TASK_RESPAWN);
   }
}

    public client_disconnect(player)
    {
        g_bsJustConnected &= ~( 1 << player );
        remove_task(player+TASK_RESPAWN)
    }


    public RespawnPlayer(taskid)
    {
        g_iCurrentModeID = zp_gamemodes_get_current()
     
        if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
        {
            static player
            player = (taskid - TASK_RESPAWN)
         
            new team = get_user_team(player);

            if(is_user_alive(player) || team == 0 || team == 3 )
                return
         
            zp_core_respawn_as_zombie(player, RESPAWN_AS_ZOMBIE)
         
            ExecuteHamB(Ham_Spawn, player)
         
            zp_random_spawn_do(player, USE_CSDM_SPAWNS)
        }
    }

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
não funciono =(

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
teste esse

Código:


        #include <  amxmodx >
        #include <  hamsandwich >
        #include <  zp50_core >
        #include <  zp50_gamemodes >
        #include <  zp50_random_spawn >

        new const PLUGIN_VERSION[] = "1.0.0"

        #define RESPAWN_AS_ZOMBIE    true
        #define USE_CSDM_SPAWNS    false

        #define TASK_RESPAWN    65639

        new CvarRespawnDelay


        new g_szGamemode1, g_szGamemode2

        new g_iCurrentModeID

        public plugin_init()
        {
            register_plugin("[ZP] Addon: Respawn on connect", PLUGIN_VERSION, "Excalibur.007")
               
            CvarRespawnDelay = register_cvar("zp_respawn_delay_on_connect", "3.0")
       
            g_szGamemode1 = zp_gamemodes_get_id("Infection Mode")
            g_szGamemode2 = zp_gamemodes_get_id("Multiple Infection Mode")
        }

    public client_putinserver(player)
    {

          set_task(get_pcvar_float(CvarRespawnDelay), "RespawnPlayer", player+TASK_RESPAWN);
     
    }


        public RespawnPlayer(taskid)
        {
            g_iCurrentModeID = zp_gamemodes_get_current()
       
            if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
            {
                static player
                player = (taskid - TASK_RESPAWN)
           
                new team = get_user_team(player);

                if(is_user_alive(player) || team == 0 || team == 3 )
                    return
           
                zp_core_respawn_as_zombie(player, RESPAWN_AS_ZOMBIE)
           
                ExecuteHamB(Ham_Spawn, player)
           
                zp_random_spawn_do(player, USE_CSDM_SPAWNS)
            }
        }

se não der esse

Código:


        #include <  amxmodx >
        #include <  hamsandwich >
        #include <  zp50_core >
        #include <  zp50_gamemodes >
        #include <  zp50_random_spawn >

        new const PLUGIN_VERSION[] = "1.0.0"

        #define RESPAWN_AS_ZOMBIE    true
        #define USE_CSDM_SPAWNS    false

        #define TASK_RESPAWN    65639

        new CvarRespawnDelay


        new g_szGamemode1, g_szGamemode2

        new g_iCurrentModeID

        public plugin_init()
        {
            register_plugin("[ZP] Addon: Respawn on connect", PLUGIN_VERSION, "Excalibur.007")
               
            CvarRespawnDelay = register_cvar("zp_respawn_delay_on_connect", "5.0")
       
            g_szGamemode1 = zp_gamemodes_get_id("Infection Mode")
            g_szGamemode2 = zp_gamemodes_get_id("Multiple Infection Mode")
        }

    public client_putinserver(player)
    {

          set_task(get_pcvar_float(CvarRespawnDelay), "RespawnPlayer", player);
     
    }


        public RespawnPlayer(player)
        {
            g_iCurrentModeID = zp_gamemodes_get_current()
       
            if(g_iCurrentModeID == g_szGamemode1 || g_iCurrentModeID == g_szGamemode2)
            {
           
                new team = get_user_team(player);

                if(is_user_alive(player) || team == 0 || team == 3 )
                    return
           
                zp_core_respawn_as_zombie(player, RESPAWN_AS_ZOMBIE)
           
                ExecuteHamB(Ham_Spawn, player)
           
                zp_random_spawn_do(player, USE_CSDM_SPAWNS)
            }
        }

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
Junin vlw, funciono
Testei apenas o 1º

description[ZP 5.0] zp50_respawn_on_connect EmptyRe: [ZP 5.0] zp50_respawn_on_connect

more_horiz
privacy_tip Permissões neste sub-fórum
Não podes responder a tópicos
power_settings_newInicie sessão para responder