Raised This Month: $ Target: $400
 0% 

Subplugin Submission Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!


Post New Thread Reply   
 
Thread Tools Display Modes
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-04-2010 , 05:58   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1111

read the code of ZPA's sma

there you will find it.

if you still cant find it. well... you fail.
__________________
jc980 is offline
GoAway
Junior Member
Join Date: Aug 2010
Old 12-04-2010 , 06:27   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1112

I found some piece of code that seems to be the code of assassinmode, but I have no coding skills so don't know how to turn THIS into THAT XD

HTML Code:
    // No light for assassin round
    if (g_assassinround)
    {
        engfunc(EngFunc_LightStyle, 0,"a")
    }
GoAway is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-04-2010 , 06:51   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1113

all you need is fakemeta.

show me code ill do it.
__________________
jc980 is offline
GoAway
Junior Member
Join Date: Aug 2010
Old 12-04-2010 , 07:03   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1114

which code do you need?

the AvS code?

Last edited by GoAway; 12-04-2010 at 07:06.
GoAway is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-04-2010 , 07:13   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1115

yes
__________________
jc980 is offline
GoAway
Junior Member
Join Date: Aug 2010
Old 12-04-2010 , 07:18   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1116

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

/************************************************************\
|                  Customizations Section                    |
|         You can edit here according to your liking         |
\************************************************************/

// 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/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_minplayerscvar_ratiocvar_sniperhpcvar_assahpg_msg_sync

// Ambience sounds task
#define TASK_AMB 3256

public plugin_init( )
{
    
// Plugin registeration.
    
register_plugin"[ZP] Assassin vs Snipers Mode","1.0""@bdul!" )
    
    
// Register some cvars
    // Edit these according to your liking
    
cvar_minplayers register_cvar("zp_avsm_minplayers""2")
    
cvar_sniperhp =      register_cvar("zp_avsm_sniper_hp""1.5")
    
cvar_assahp =      register_cvar("zp_avsm_assassin_hp""1.0")
    
cvar_ratio =       register_cvar("zp_avsm_inf_ratio""0.5")
    
    
// 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"Assassin vs Snipers 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( should_be_zombie == )
        {
            
// Make him an assassin instead
            
zp_make_user_assassinid )

            
// Set his health
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_assahp)) )
        }
        else
        {
            
// Make him a sniper
            
zp_make_user_sniperid )

            
// Set his health
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_sniperhp)) )
        }

        
/**
         * Note:
         * This very necessary, you should return ZP_PLUGIN_HANDLED, if
         * you have used this forward and/or have performed an action
         * while using it, so that the main plugin will be informed about
         * this forward's usage.
         */
        
return ZP_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"Assassins vs Snipers 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 get_pcvar_floatcvar_ratio ) ), 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)
            
            
// Set his health
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_assahp)) )
            
            
// 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) )
            continue;
            
        
// Turn into a sniper
        
zp_make_user_sniper(id)
        
        
// Set his health
        
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_sniperhp)) )
    }
}

#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;

here ya go, thanks for taking a look on it^^

edit: [I actually managed to turn it dark on roundstart but not to turn it back on round end?]

Last edited by GoAway; 12-04-2010 at 08:02.
GoAway is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-04-2010 , 08:21   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1117

add this:

PHP Code:
#include <fakemeta> 
to plugin_init():

PHP Code:
set_task(2.5,"lighting_avs",_,_,_,"b"
anywere in the sma:

PHP Code:
public lighting_avs()
{
new 
lights[32]
get_cvar_string("zp_lighting"lights31)

if(!
g_gameid)
 
engfunc(EngFunc_LightStyle0lights)

if(
g_gameid)
 
engfunc(EngFunc_LightStyle0a)

tell me if it works
__________________
jc980 is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-04-2010 , 08:36   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1118

Quote:
Originally Posted by GoAway View Post
PHP Code:
#include < amxmodx >
#include < fun >
#include < zombie_plague_advance >

/************************************************************\
|                  Customizations Section                    |
|         You can edit here according to your liking         |
\************************************************************/

// 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/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_minplayerscvar_ratiocvar_sniperhpcvar_assahpg_msg_sync

// Ambience sounds task
#define TASK_AMB 3256

public plugin_init( )
{
    
// Plugin registeration.
    
register_plugin"[ZP] Assassin vs Snipers Mode","1.0""@bdul!" )
    
    
// Register some cvars
    // Edit these according to your liking
    
cvar_minplayers register_cvar("zp_avsm_minplayers""2")
    
cvar_sniperhp =      register_cvar("zp_avsm_sniper_hp""1.5")
    
cvar_assahp =      register_cvar("zp_avsm_assassin_hp""1.0")
    
cvar_ratio =       register_cvar("zp_avsm_inf_ratio""0.5")
    
    
// 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"Assassin vs Snipers 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( should_be_zombie == )
        {
            
// Make him an assassin instead
            
zp_make_user_assassinid )

            
// Set his health
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_assahp)) )
        }
        else
        {
            
// Make him a sniper
            
zp_make_user_sniperid )

            
// Set his health
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_sniperhp)) )
        }

        
/**
         * Note:
         * This very necessary, you should return ZP_PLUGIN_HANDLED, if
         * you have used this forward and/or have performed an action
         * while using it, so that the main plugin will be informed about
         * this forward's usage.
         */
        
return ZP_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"Assassins vs Snipers 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 get_pcvar_floatcvar_ratio ) ), 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)
            
            
// Set his health
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_assahp)) )
            
            
// 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) )
            continue;
            
        
// Turn into a sniper
        
zp_make_user_sniper(id)
        
        
// Set his health
        
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_sniperhp)) )
    }
}

#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;

here ya go, thanks for taking a look on it^^

edit: [I actually managed to turn it dark on roundstart but not to turn it back on round end?]
I will do that for u in next version

BTW i still need u guy's feed back
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 12-04-2010 , 08:40   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1119

make the gameplay like biohazard

at start
(human with virus)
bioscan: youre infected

at zp round start

(human of course, gets infected)
bioscan: YOURE INFECTED!!!!!
__________________
jc980 is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 12-04-2010 , 08:57   Re: Zombie Plague Advance !! Updated to v1.6.1 on 11th September 2010 !!
Reply With Quote #1120

Quote:
Originally Posted by jc980 View Post
make the gameplay like biohazard

at start
(human with virus)
bioscan: youre infected

at zp round start

(human of course, gets infected)
bioscan: YOURE INFECTED!!!!!
I dont like it that way !!
That person would just keep on sticking to other humans until he becomes a zombie
BTW ZP's system of infection is diferent, the person who is to be the first zombie is actually choden after 10 seconds (zp_delay cvar)
Where as in BIO, the person is chosen at round start and then made the zombie after a specific time !
So its really difficult to do that,
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
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 01:48.


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