Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Otomatik respawn (Belirli modlarda)
#7
Baska bir forumda istegimi belirttim ve saolsun plugini verdiler. Ihtiyaci olan varsa kodlar asagida. Yardimin icin tesekkürler

Code:
#include <amxmodx>  
#include <hamsandwich>  
#include <zp50_core>  
#include <zp50_gamemodes>  

#define _PLUGIN   "[ZP50] Respawn System"  
#define _AUTHOR        "H.RED.ZONE"  
#define _VERSION           "1.0"  

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

const Float:AUTORESPAWN_DELAY = 5.0  

new _gGameModeNemesisID, _gGameModeSurvivorID, _gGameModeMultiID, _gGameModeInfectionID,  _gGameModeSwarmID  
    
new _pCvarDeathMatch
new _gMaxPlayers  

public plugin_init()
{  
    register_plugin(_PLUGIN, _VERSION, _AUTHOR)  
      
    register_clcmd("joinclass","cmd_joinclass")  
      
    register_menucmd(register_menuid("Terrorist_Select",1),511,"cmd_joinclass")  
    register_menucmd(register_menuid("CT_Select",1),511,"cmd_joinclass")  
          
    _gMaxPlayers = get_maxplayers()  
}  

public plugin_cfg()  
{  
    _gGameModeNemesisID = zp_gamemodes_get_id("Nemesis Mode")  
    _gGameModeSurvivorID = zp_gamemodes_get_id("Survivor Mode")  
    _gGameModeMultiID = zp_gamemodes_get_id("Multiple Infection Mode")
    _gGameModeInfectionID = zp_gamemodes_get_id("Infection Mode")
    _pCvarDeathMatch = get_cvar_pointer("zp_deathmatch")
    _gGameModeSwarmID = zp_gamemodes_get_id("Swarm Mode")
}  

public cmd_joinclass(id)  
{  
    if (!get_pcvar_num(_pCvarDeathMatch))  
        return;  
    

         if(zp_gamemodes_get_current() == _gGameModeInfectionID || zp_gamemodes_get_current() == _gGameModeMultiID || zp_gamemodes_get_current() == _gGameModeSwarmID) {
                  set_task(AUTORESPAWN_DELAY, "auto_respawn_player", id+TASK_AUTORESPAWN)  
    }
}  

public auto_respawn_player(taskid)  
{  
    if (is_user_alive(ID_AUTORESPAWN))  
        return;  
      
    if( zp_gamemodes_get_current() == _gGameModeSurvivorID )  
    {  
        zp_core_respawn_as_zombie(ID_AUTORESPAWN, true)  
        
    }  
    
    else if( zp_gamemodes_get_current() == _gGameModeNemesisID )  
    {  
        zp_core_respawn_as_zombie(ID_AUTORESPAWN, false)  
    }  
    
    else if (!is_user_alive(ID_AUTORESPAWN) || get_pcvar_num(_pCvarDeathMatch) == 2 || (get_pcvar_num(_pCvarDeathMatch) == 3 && random_num(0, 1)) || (get_pcvar_num(_pCvarDeathMatch) == 4 && zp_core_get_zombie_count() < fnGetAlive()/2))  
    {  
                zp_core_respawn_as_zombie(ID_AUTORESPAWN, true)  
    }  
    
    else  
    
    {  
        zp_core_respawn_as_zombie(ID_AUTORESPAWN, false)  
    }  
    
    ExecuteHamB(Ham_CS_RoundRespawn, ID_AUTORESPAWN)  
}  

fnGetAlive()
{  
    new iAlive, id  
      
    for (id = 1; id <= _gMaxPlayers; id++)
    {  
        if (is_user_alive(id))  
            iAlive++  
    }  
    return iAlive;  
}
Reply


Messages In This Thread
Cevap: Otomatik respawn (Belirli modlarda) - by wienli - 16-02-14, 00:43

Possibly Related Threads…
Thread Author Replies Views Last Post
  ZP Spawn Koruması ve ZP Respawn sakarya42 6 6,578 10-10-17, 19:50
Last Post: EfeDursun125
  [ZP] Respawn Sıkıntısı Çekenler İçeri ResidentEviL 3 5,054 08-10-17, 00:11
Last Post: EfeDursun125
  [ İSTEK ] Belirli Yetki Hariç 3 Raund Weapon Engel excellenT 15 6,343 21-07-17, 03:49
Last Post: SINCAPP
  Serverini Otomatik Olarak Favorilere Ekleme ottomanred 6 7,970 24-05-16, 15:15
Last Post: hola
  Paraşüt Plugini Arıyorum fakat herkezde Otomatik olsun al_99 7 4,678 19-04-15, 20:07
Last Post: bireysel
  Cs Acılınca Otomatik Servere Bağlanma mahmutt159 5 6,329 21-07-14, 04:04
Last Post: kaptan647
  Adminlere özel respawn dehset2329 10 7,299 15-02-14, 13:37
Last Post: JDM
  Otomatik Respawn mcym 15 7,108 27-11-13, 20:18
Last Post: JDM
  otomatik say çıkması cskarabela 8 8,992 20-11-13, 22:06
Last Post: bilbaz
  Yardım .. Her El Otomatik 16000 PARA VERME !! nafiz519 2 8,620 28-10-13, 17:54
Last Post: akcaliberkk

Foruma Atla:


Users browsing this thread: 1 Guest(s)