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

[Tutorial] Sixth lesson in a series develop [ZPA 1.61] - State Disconnect Zm/Human.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-09-2015 , 14:24   [Tutorial] Sixth lesson in a series develop [ZPA 1.61] - State Disconnect Zm/Human.
Reply With Quote #1

Sixth Lesson Add (State Disconnect)
- all rights reserved to arvEL.-, in : 9/12/2015
In these lesson i will explain how to develop [Zombie Plague Advance v1.6.1]
re write state disconnect zombie/human.

first go to this topic [ # ] and download
[ZPA 1.6.1]
after that open the file [zombie_plague_advance_v1-6-1.sma] in [notepad++]

first press [Ctrl + F] and find this line:

PHP Code:
// Check Round Task -check that we still have both zombies and humans on a round 
it's have codes:

PHP Code:
// Check Round Task -check that we still have both zombies and humans on a round-
check_round(leaving_player)
{
    
// Round ended or make_a_zombie task still active
    
if (g_endround || task_exists(TASK_MAKEZOMBIE))
        return;
    
    
// Get alive players count
    
static iPlayersnumid
    iPlayersnum 
fnGetAlive()
    
    
// Last alive player, don't bother
    
if (iPlayersnum 2)
        return;
    
    
// Last zombie disconnecting
    
if (g_zombie[leaving_player] && fnGetZombies() == 1)
    {
        
// Only one CT left, don't bother
        
if (fnGetHumans() == && fnGetCTs() == 1)
            return;
        
        
// Pick a random one to take his place
        
while ((id fnGetRandomAlive(random_num(1iPlayersnum))) == leaving_player ) { /* keep looping */ }
        
        
// Show last zombie left notice
        
zp_colored_print(0"^x04[ZP]^x01 %L"LANG_PLAYER"LAST_ZOMBIE_LEFT"g_playername[id])
        
        
// Set player leaving flag
        
g_lastplayerleaving true
        
        
// Turn into a Nemesis, Assassin or just a zombie?
        
if (g_nemesis[leaving_player])
            
zombieme(id01000)
        else if (
g_assassin[leaving_player])
            
zombieme(id00001)
        else
            
zombieme(id00000)
        
        
// Remove player leaving flag
        
g_lastplayerleaving false
        
        
// If Nemesis, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_nemesis[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
            
        
// If Assassin, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_assassin[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
    }
    
    
// Last human disconnecting
    
else if (!g_zombie[leaving_player] && fnGetHumans() == 1)
    {
        
// Only one T left, don't bother
        
if (fnGetZombies() == && fnGetTs() == 1)
            return;
        
        
// Pick a random one to take his place
        
while ((id fnGetRandomAlive(random_num(1iPlayersnum))) == leaving_player ) { /* keep looping */ }
        
        
// Show last human left notice
        
zp_colored_print(0"^x04[ZP]^x01 %L"LANG_PLAYER"LAST_HUMAN_LEFT"g_playername[id])
        
        
// Set player leaving flag
        
g_lastplayerleaving true
        
        
// Turn into a Survivor, Sniper or just a human?
        
if (g_survivor[leaving_player])
            
humanme(id100)
        else if (
g_sniper[leaving_player])
            
humanme(id001)
        else
            
humanme(id000)
        
        
// Remove player leaving flag
        
g_lastplayerleaving false
        
        
// If Survivor, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_survivor[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
        
        
// If Sniper, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_sniper[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
    }

replace all codes to:

PHP Code:
// Check Round Task -check that we still have both zombies and humans on a round-
check_round(leaving_player)
{
    
// Round ended or make_a_zombie task still active
    
if (g_endround || task_exists(TASK_MAKEZOMBIE))
        return;
    
    
// Get alive players count
    
static iPlayersnumid
    iPlayersnum 
fnGetAlive()
    
    
// Last alive player, don't bother
    
if (iPlayersnum 2)
        return;
    
    
// Last zombie disconnecting
    
if (g_zombie[leaving_player] && fnGetZombies() == 1)
    {
        
// Only one CT left, don't bother
        
if (fnGetHumans() == && fnGetCTs() == 1)
            return;
        
        
// Pick a random one to take his place
        
while ((id fnGetRandomAlive(random_num(1iPlayersnum))) == leaving_player ) { /* keep looping */ }
        
        
// Show last zombie left notice
        
client_print_color(0Grey"^x04[ZP]^x01 Last zombie,^x03 %s^x01 disconnected,^x04 %s^x01 is the last zombie!"g_playername[leaving_player], g_playername[id])
        
        
// Set player leaving flag
        
g_lastplayerleaving true
        
        
// Turn into a Nemesis, Assassin or just a zombie?
        
if (g_nemesis[leaving_player])
            
zombieme(id01000)
        else if (
g_assassin[leaving_player])
            
zombieme(id00001)
        else
            
zombieme(id00000)
        
        
// Remove player leaving flag
        
g_lastplayerleaving false
        
        
// If Nemesis, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_nemesis[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
            
        
// If Assassin, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_assassin[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
    }
    
    
// Last human disconnecting
    
else if (!g_zombie[leaving_player] && fnGetHumans() == 1)
    {
        
// Only one T left, don't bother
        
if (fnGetZombies() == && fnGetTs() == 1)
            return;
        
        
// Pick a random one to take his place
        
while ((id fnGetRandomAlive(random_num(1iPlayersnum))) == leaving_player ) { /* keep looping */ }
        
        
// Show last human left notice
        
client_print_color(0Grey"^x04[ZP]^x01 Last human,^x03 %s^x01 disconnected,^x04 %s^x01 is the last human!"g_playername[leaving_player], g_playername[id])
        
        
// Set player leaving flag
        
g_lastplayerleaving true
        
        
// Turn into a Survivor, Sniper or just a human?
        
if (g_survivor[leaving_player])
            
humanme(id100)
        else if (
g_sniper[leaving_player])
            
humanme(id001)
        else
            
humanme(id000)
        
        
// Remove player leaving flag
        
g_lastplayerleaving false
        
        
// If Survivor, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_survivor[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
        
        
// If Sniper, set chosen player's health to that of the one who's leaving
        
if (get_pcvar_num(cvar_keephealthondisconnect) && g_sniper[leaving_player])
            
fm_set_user_health(idpev(leaving_playerpev_health))
    }

now make compile and ejnoy
all rights reserved to arvEL.-

__________________

Last edited by arvEL.; 12-09-2015 at 14:25.
arvEL. is offline
Send a message via Skype™ to arvEL.
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 02-03-2016 , 22:14   Re: [Tutorial] Sixth lesson in a series develop [ZPA 1.61] - State Disconnect Zm/Huma
Reply With Quote #2

not an important thing anyway nice tuto that's will help
__________________
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 02-04-2016 , 17:00   Re: [Tutorial] Sixth lesson in a series develop [ZPA 1.61] - State Disconnect Zm/Huma
Reply With Quote #3

lol not recomended but nice tut keep it up
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
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 21:45.


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