AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   sniper vs nemesis mode (https://forums.alliedmods.net/showthread.php?t=261896)

StarMpK 04-23-2015 03:44

sniper vs nemesis mode
 
Hi moders , i need the sma of sniper versus nemesis mode for ZPA.
Can somebody help me?

bakir123 04-23-2015 06:19

Re: sniper vs nemesis mode
 
2 Attachment(s)
take:
if sma file not work use amxx

Obada 04-23-2015 06:24

Re: sniper vs nemesis mode
 
You're not allowed to post .amxx files.

Keys PK 04-23-2015 06:25

Re: sniper vs nemesis mode
 
try
PHP Code:

#include < amxmodx >
#include < fun >
#include < zombie_plague_advance >

new const g_chance 15
new const g_access_flag[] = "a"
new const g_play_sounds[][] =
{
    
"zombie_plague/sniper1.wav" ,
    
"zombie_plague/nemesis1.wav"
}

#define AMBIENCE_SOUNDS
#if defined AMBIENCE_SOUNDS

new const g_sound_ambience[][] =

    
"zombie_plague/ambience.wav"
}
new const 
Float:g_sound_ambience_duration[] = { 58.0 56.0 }
#endif

new g_gameidg_maxplayerscvar_minplayerscvar_ratiocvar_sniperhpcvar_nemehpg_msg_sync

// Ambience sounds task
#define TASK_AMB 3256

public plugin_init( )
{
    
register_plugin"[ZPA] Game mode : Sniper vs Nemesis","1.0""@bdul!" )

    
cvar_minplayers register_cvar("zp_svsn_minplayers""2")
    
cvar_sniperhp =      register_cvar("zp_svsn_sniper_hp""1.5")
    
cvar_nemehp =      register_cvar("zp_svsn_nemesis_hp""1.0")
    
cvar_ratio =       register_cvar("zp_svsn_inf_ratio""0.5")
    
    
g_maxplayers get_maxplayers( )
    
    
g_msg_sync CreateHudSyncObj()
}

public 
plugin_precache( )
{
    new 
access_flag read_flagsg_access_flag )
    new 
i
    
    
for (0sizeof g_play_soundsi++)
        
precache_soundg_play_sounds[i] )
    
    
#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
    
    
g_gameid zp_register_game_mode"Sniper vs Nemesis"access_flagg_chance0ZP_DM_BALANCE )
}

public 
zp_player_spawn_postid )
{
    if( 
zp_get_current_mode() == g_gameid )
    {
        if( 
zp_get_user_zombieid ))
        {
            
zp_make_user_nemesisid )
            
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_nemehp)) )
        }
        else
        {
            
zp_make_user_sniperid )
            
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_sniperhp)) )
        }
    }
}

public 
zp_round_started_pregame )
{
    if( 
game == g_gameid )
    {
        if( 
fn_get_alive_players() < get_pcvar_num(cvar_minplayers) )
        {
            return 
ZP_PLUGIN_HANDLED
        
}
        
start_avs_mode( )
    }
    return 
PLUGIN_CONTINUE
}

public 
zp_round_startedgameid )
{
    if( 
game == g_gameid )
    {
        
set_hudmessage(22115621, -1.00.1710.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_msg_sync"Sniper vs Nemesis Mode !!!")
        
        
client_cmd(0"spk ^"%s^""g_play_soundsrandom_num(0sizeof g_play_sounds -1) ] )
        
        
remove_taskTASK_AMB )
        
        
#if defined AMBIENCE_SOUNDS
        
set_task2.0"start_ambience_sounds"TASK_AMB )
        
#endif
    
}
}

public 
zp_game_mode_selectedgameidid )
{
    if( 
gameid == g_gameid )
        
start_avs_mode( )
    
    return 
PLUGIN_CONTINUE
}

start_avs_mode( )
{
    static 
i_nemesisi_max_nemesisidi_alive
    i_alive 
fn_get_alive_players()
    
id 0
    
    i_max_nemesis 
floatround( ( i_alive get_pcvar_floatcvar_ratio ) ), floatround_ceil )
    
i_nemesis 0
    
    
while (i_nemesis i_max_nemesis)
    {
        if ( (++
id) > g_maxplayersid 1
        
        
if ( !is_user_alive(id) )
            continue;
        
        if (
random_num(15) == 1)
        {
            
zp_make_user_nemesis(id)
            
            
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_nemehp)) )
            
            
i_nemesis++
        }
    }
    
    for (
id 1id <= g_maxplayersid++)
    {
        if ( !
is_user_alive(id) || zp_get_user_nemesis(id) )
            continue;
            
        
zp_make_user_sniper(id)
        
        
set_user_healthidfloatround(get_user_health(id) * get_pcvar_float(cvar_sniperhp)) )
    }
}

#if defined AMBIENCE_SOUNDS
public start_ambience_sounds( )
{
    static 
amb_sound[64], soundFloat:duration

    sound 
random_num0sizeof g_sound_ambience )
    
copyamb_soundsizeof amb_sound g_sound_ambiencesound ] )
    
duration g_sound_ambience_durationsound ]
    
    if ( 
equalamb_soundstrlenamb_sound ) - ], ".mp3" ) )
        
client_cmd0"mp3 play ^"sound/%s^""amb_sound )
    else
        
client_cmd0"spk ^"%s^""sound )
    
    
set_taskduration"start_ambience_sounds"TASK_AMB )
}
public 
zp_round_endedwinteam )
{
    
remove_taskTASK_AMB )
}
#endif

fn_get_alive_players( )
{
    static 
i_aliveid
    i_alive 
0
    
    
for ( id 1id <= g_maxplayersid++ )
    {
        if( 
is_user_aliveid ) )
            
i_alive++
    }
    return 
i_alive;



bakir123 04-23-2015 06:26

Re: sniper vs nemesis mode
 
Quote:

Originally Posted by Obada (Post 2289294)
You're not allowed to post .amxx files.

why man ? and ? what do u need?
يا عبيدة؟ خير شو بدك ؟

Kia 04-23-2015 06:52

Re: sniper vs nemesis mode
 
Quote:

Originally Posted by bakir123 (Post 2289298)
why man ? and ? what do u need?
يا عبيدة؟ خير شو بدك ؟

Only staff members are allowed to post binary files. Read the board rules.

StarMpK 04-23-2015 09:56

Re: sniper vs nemesis mode
 
thx Keys it's working great. [RO] Dau o bere :))

Keys PK 04-23-2015 14:50

Re: sniper vs nemesis mode
 
[EN] I'm glad it's working , didn't test it
[RO] Ma bucur ca merge :)) nu l-am testat, ms de bere xdd


All times are GMT -4. The time now is 15:13.

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