Raised This Month: $ Target: $400
 0% 

[Request] Edit Scrpit NightMare Mode!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Acer.7
Junior Member
Join Date: Sep 2014
Old 02-13-2015 , 19:57   [Request] Edit Scrpit NightMare Mode!
Reply With Quote #1

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


// This is the chance value according to which this game mode will be called
// The higher the value the lesser the chance of calling this game mode
new const g_chance 15

// This is the access flag required to start the game mode
// through the admin menu. Look in users.ini for more details
new const g_access_flag[] = "a"

// This is the sound which is played when the game mode is triggered
// Add as many as you want [Randomly chosen if more than one]
new const g_play_sounds[][] =

{
    
"zombie_plague/nemesis1.wav" ,
    
"zombie_plague/survivor1.wav"
}

// Comment the following line to disable ambience sounds
// Just add two slashes ( // )
#define AMBIENCE_SOUNDS

#if defined AMBIENCE_SOUNDS
// Ambience Sounds (only .wav and .mp3 formats supported)
// Add as many as you want [Randomly chosen if more than one]
new const g_sound_ambience[][] =

    
"zombie_plague/new_ambience.wav"
}

// Duration in seconds of each sound
new const Float:g_sound_ambience_duration[] = { 58.0 56.0 }
#endif

/************************************************************\
|                  Customizations Ends Here..!!              |
|         You can edit the cvars in the plugin init          |
\************************************************************/

// Variables
new g_gameidg_maxplayerscvar_minplayersg_msg_sync

// Ambience sounds task
#define TASK_AMB 3256

public plugin_init( )
{
    
// Plugin registeration.
    
register_plugin"[ZP] Nightmare mode","1.0""@bdul!" )
    
    
// Register some cvars
    // Edit these according to your liking
    
cvar_minplayers register_cvar("zp_avsm_minplayers""2")
    
    
// Get maxplayers
    
g_maxplayers get_maxplayers( )
    
    
// Hud stuff
    
g_msg_sync CreateHudSyncObj()
}

// Game modes MUST be registered in plugin precache ONLY
public plugin_precache( )
{
    
// Read the access flag
    
new access_flag read_flagsg_access_flag )
    new 
i
    
    
// Precache the play sounds
    
for (0sizeof g_play_soundsi++)
        
precache_soundg_play_sounds[i] )
    
    
// Precache the ambience sounds
    #if defined AMBIENCE_SOUNDS
    
new sound[100]
    for (
0sizeof g_sound_ambiencei++)
    {
        if (
equal(g_sound_ambience[i][strlen(g_sound_ambience[i])-4], ".mp3"))
        {
            
formatex(soundsizeof sound 1"sound/%s"g_sound_ambience[i])
            
precache_genericsound )
        }
        else
        {
            
precache_soundg_sound_ambience[i] )
        }
    }
    
#endif
    
    // Register our game mode
    
g_gameid zp_register_game_mode"Night-Mare Mode"access_flagg_chance0ZP_DM_BALANCE )
}

// Player spawn post
public zp_player_spawn_postidshould_be_zombie )
{
    
// Check for current mode
    
if ( zp_get_current_mode() == g_gameid )
    {
        
// Check if the player was to be made a zombie
        
if (zp_get_human_count() > zp_get_zombie_count())
        {
            if( 
zp_get_assassin_count() > zp_get_nemesis_count() )
                
zp_make_user_nemesisid // make him an assassin instead
            
else
                
zp_make_user_assassinid )
        }
        else
        {
            if( 
zp_get_sniper_count() > zp_get_survivor_count() )
                
zp_make_user_survivorid )
            else
                
zp_make_user_sniperid )
        }
        
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}

public 
zp_round_started_pregame )
{
    
// Check if it is our game mode
    
if( game == g_gameid )
    {
        
// Check for min players
        
if( fn_get_alive_players() < get_pcvar_num(cvar_minplayers) )
        {
            
/**
            * Note:
            * This very necessary, you should return ZP_PLUGIN_HANDLED if
            * some conditions required by your game mode are not met
            * This will inform the main plugin that you have rejected
            * the offer and so the main plugin will allow other game modes
            * to be given a chance
            */
            
return ZP_PLUGIN_HANDLED
        
}
        
// Start our new mode
        
start_avs_mode( )
    }
    
// Make the compiler happy =)
    
return PLUGIN_CONTINUE
}

public 
zp_round_startedgameid )
{
    
// Check if it is our game mode
    
if( game == g_gameid )
    {
        
// Show HUD notice
        
set_hudmessage(22115621, -1.00.1710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_msg_sync"NightMare Mode !!!")
        
        
// Play the starting sound
        
client_cmd(0"spk ^"%s^""g_play_soundsrandom_num(0sizeof g_play_sounds -1) ] )
        
        
// Remove ambience task affects
        
remove_taskTASK_AMB )
        
        
// Set task to start ambience sounds
        #if defined AMBIENCE_SOUNDS
        
set_task2.0"start_ambience_sounds"TASK_AMB )
        
#endif
    
}
}

public 
zp_game_mode_selectedgameidid )
{
    
// Check if our game mode was called
    
if( gameid == g_gameid )
        
start_avs_mode( )
    
    
// Make the compiler happy again =)
    
return PLUGIN_CONTINUE
}

// This function contains the whole code behind this game mode
start_avs_mode( )
{
    
// Create and initialize some important vars
    
static i_assassinsi_max_assassinsidi_alive
    i_alive 
fn_get_alive_players()
    
id 0
    
    
// Get the no of players we have to turn into assassins
    
i_max_assassins floatround( ( i_alive 0.25), floatround_ceil )
    
i_assassins 0
    
    
// Randomly turn players into Assassins
    
while (i_assassins i_max_assassins)
    {
        
// Keep looping through all players
        
if ( (++id) > g_maxplayersid 1
        
        
// Dead
        
if ( !is_user_alive(id) )
            continue;
        
        
// Random chance
        
if (random_num(15) == 1)
        {
            
// Make user assassin
            
zp_make_user_assassin(id)
            
            
// Increase counter
            
i_assassins++
        }
    }
    
    
i_assassins 0
    
    
// Randomly turn players into Assassins
    
while (i_assassins i_max_assassins)
    {
        
// Keep looping through all players
        
if ( (++id) > g_maxplayersid 1
        
        
// Dead
        
if ( !is_user_alive(id) || zp_get_user_assassin(id))
            continue;
        
        
// Random chance
        
if (random_num(15) == 1)
        {
            
// Make user assassin
            
zp_make_user_nemesis(id)
            
            
// Increase counter
            
i_assassins++
        }
    }
    
    
i_assassins 0
    
    
// Randomly turn players into Assassins
    
while (i_assassins i_max_assassins)
    {
        
// Keep looping through all players
        
if ( (++id) > g_maxplayersid 1
        
        
// Dead
        
if ( !is_user_alive(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id) )
            continue;
        
        
// Random chance
        
if (random_num(15) == 1)
        {
            
// Make user assassin
            
zp_make_user_survivor(id)
            
            
// Increase counter
            
i_assassins++
        }
    }
    
    
// Turn the remaining players into snipers
    
for (id 1id <= g_maxplayersid++)
    {
        
// Only those of them who are alive and are not assassins
        
if ( !is_user_alive(id) || zp_get_user_assassin(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id) )
            continue;
        
        
// Turn into a sniper
        
zp_make_user_sniper(id)
    }
}

#if defined AMBIENCE_SOUNDS
public start_ambience_sounds( )
{
    
// Variables
    
static amb_sound[64], soundFloat:duration
    
    
// Select our ambience sound
    
sound random_num0sizeof g_sound_ambience )
    
copyamb_soundsizeof amb_sound g_sound_ambiencesound ] )
    
duration g_sound_ambience_durationsound ]
    
    
// Check whether it's a wav or mp3, then play it on clients
    
if ( equalamb_soundstrlenamb_sound ) - ], ".mp3" ) )
        
client_cmd0"mp3 play ^"sound/%s^""amb_sound )
    else
        
client_cmd0"spk ^"%s^""sound )
    
    
// Start the ambience sounds
    
set_taskduration"start_ambience_sounds"TASK_AMB )
}
public 
zp_round_endedwinteam )
{
    
// Stop ambience sounds on round end
    
remove_taskTASK_AMB )
}
#endif

// This function returns the no. of alive players
// Feel free to use this in your plugin when you 
// are making your own game modes.
fn_get_alive_players( )
{
    static 
i_aliveid
    i_alive 
0
    
    
for ( id 1id <= g_maxplayersid++ )
    {
        if( 
is_user_aliveid ) )
            
i_alive++
    }
    return 
i_alive;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
*/ 
i want disabled re-spawn player after die
Acer.7 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-14-2015 , 05:20   Re: [Request] Edit Scrpit NightMare Mode!
Reply With Quote #2

There is no code for respawn any players in the given code.
zmd94 is offline
Acer.7
Junior Member
Join Date: Sep 2014
Old 02-14-2015 , 05:38   Re: [Request] Edit Scrpit NightMare Mode!
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
There is no code for respawn any players in the given code.
lol but why any mod in ZP advance have re-spawn player after die????
i want disable it plz help me
Acer.7 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 02-14-2015 , 06:15   Re: [Request] Edit Scrpit NightMare Mode!
Reply With Quote #4

Just edit the .cfg file:
Code:
// Deathmatch
// ----------
zp_deathmatch 0 // Deathmatch mode, respawn as: [0-disabled // 1-human // 2-zombie // 3-randomly // 4-balance]
zp_spawn_delay 3 // Delay before respawning on deathmatch mode in seconds
zp_spawn_protection 1 // Spawn protection time for deathmatch in seconds [0-disabled]
zp_respawn_on_suicide 1 // Respawn players if they commited suicide
zp_respawn_after_last_human 0 // Respawn players if only the last human is left
zp_infection_allow_respawn 1 // Allow respawning on infection rounds
zp_nem_allow_respawn 0 // Allow respawning on nemesis rounds
zp_surv_allow_respawn 0 // Allow respawning on survivor rounds
zp_sniper_allow_respawn 0 // Allow respawning on sniper rounds
zp_assassin_allow_respawn 0 // Allow respawning on assassin rounds
zp_swarm_allow_respawn 0 // Allow respawning on swarm rounds
zp_plague_allow_respawn 0 // Allow respawning on plague rounds
zp_respawn_zombies 1 // Whether to respawn killed zombies
zp_respawn_humans 1 // Whether to respawn killed humans
zp_respawn_nemesis 0 // Whether to respawn killed nemesis
zp_respawn_survivors 0 // Whether to respawn killed survivors
zp_respawn_snipers 0 // Whether to respawn killed snipers
zp_respawn_assassins 0 // Whether to respawn killed assassins
zp_lnj_allow_respawn 0 // Allow respawning on armageddon rounds
zp_lnj_respawn_surv 1 // Whether to turn a spawned human into a survivor during Armageddon mode
zp_lnj_respawn_nem 1 // Whether to turn a spawned zombie into a nemesis during Armageddon mode
zmd94 is offline
Acer.7
Junior Member
Join Date: Sep 2014
Old 02-14-2015 , 12:58   Re: [Request] Edit Scrpit NightMare Mode!
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
Just edit the .cfg file:
Code:
// Deathmatch
// ----------
zp_deathmatch 0 // Deathmatch mode, respawn as: [0-disabled // 1-human // 2-zombie // 3-randomly // 4-balance]
zp_spawn_delay 3 // Delay before respawning on deathmatch mode in seconds
zp_spawn_protection 1 // Spawn protection time for deathmatch in seconds [0-disabled]
zp_respawn_on_suicide 1 // Respawn players if they commited suicide
zp_respawn_after_last_human 0 // Respawn players if only the last human is left
zp_infection_allow_respawn 1 // Allow respawning on infection rounds
zp_nem_allow_respawn 0 // Allow respawning on nemesis rounds
zp_surv_allow_respawn 0 // Allow respawning on survivor rounds
zp_sniper_allow_respawn 0 // Allow respawning on sniper rounds
zp_assassin_allow_respawn 0 // Allow respawning on assassin rounds
zp_swarm_allow_respawn 0 // Allow respawning on swarm rounds
zp_plague_allow_respawn 0 // Allow respawning on plague rounds
zp_respawn_zombies 1 // Whether to respawn killed zombies
zp_respawn_humans 1 // Whether to respawn killed humans
zp_respawn_nemesis 0 // Whether to respawn killed nemesis
zp_respawn_survivors 0 // Whether to respawn killed survivors
zp_respawn_snipers 0 // Whether to respawn killed snipers
zp_respawn_assassins 0 // Whether to respawn killed assassins
zp_lnj_allow_respawn 0 // Allow respawning on armageddon rounds
zp_lnj_respawn_surv 1 // Whether to turn a spawned human into a survivor during Armageddon mode
zp_lnj_respawn_nem 1 // Whether to turn a spawned zombie into a nemesis during Armageddon mode
DONE!
thx bro <3
شكرا جزيلا لك اخي <3
Acer.7 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-14-2015 , 14:04   Re: [Request] Edit Scrpit NightMare Mode!
Reply With Quote #6

Requests clearly belong in the Requests forum.
__________________
fysiks is offline
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 02:17.


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