Raised This Month: $ Target: $400
 0% 

help sniper mode


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
B7PK
Member
Join Date: Apr 2016
Location: palestine
Old 06-02-2016 , 12:25   help sniper mode
Reply With Quote #1

hello guys...we know in the sniper gamemod be 1 sniper vs all zombie's
i want to make 1 sniper vs all nemesis help please

Mod ZP 5.0.8
full cod Sniper gamemod
PHP Code:
/*================================================================================
    
    --------------------------------
    -*- [ZP] Game Mode: Sniper -*-
    --------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <amx_settings_api>
#include <zp50_gamemodes>
#include <zp50_class_sniper>
#include <zp50_deathmatch>

// Settings file
new const ZP_SETTINGS_FILE[] = "zombieplague.ini"

// Default sounds
new const sound_sniper[][] = { "zombie_plague/survivor1.wav" "zombie_plague/survivor2.wav" }

#define SOUND_MAX_LENGTH 64

new Array:g_sound_sniper

// HUD messages
#define HUD_EVENT_X -1.0
#define HUD_EVENT_Y 0.17
#define HUD_EVENT_R 20
#define HUD_EVENT_G 20
#define HUD_EVENT_B 255

new g_MaxPlayers
new g_HudSync
new g_TargetPlayer

new cvar_sniper_chancecvar_sniper_min_players
new cvar_sniper_show_hudcvar_sniper_sounds
new cvar_sniper_allow_respawn

public plugin_precache()
{
    
// Register game mode at precache (plugin gets paused after this)
    
register_plugin("[ZP] Game Mode: sniper"ZP_VERSION_STRING"ZP Dev Team")
    
zp_gamemodes_register("Sniper Mode")
    
    
// Create the HUD Sync Objects
    
g_HudSync CreateHudSyncObj()
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_sniper_chance register_cvar("zp_sniper_chance""20")
    
cvar_sniper_min_players register_cvar("zp_sniper_min_players""0")
    
cvar_sniper_show_hud register_cvar("zp_sniper_show_hud""1")
    
cvar_sniper_sounds register_cvar("zp_sniper_sounds""1")
    
cvar_sniper_allow_respawn register_cvar("zp_sniper_allow_respawn""0")
    
    
// Initialize arrays
    
g_sound_sniper ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND sniper"g_sound_sniper)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_sniper) == 0)
    {
        for (
index 0index sizeof sound_sniperindex++)
            
ArrayPushString(g_sound_snipersound_sniper[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ROUND sniper"g_sound_sniper)
    }
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_sniper); index++)
    {
        
ArrayGetString(g_sound_sniperindexsoundcharsmax(sound))
        if (
equal(sound[strlen(sound)-4], ".mp3"))
        {
            
format(soundcharsmax(sound), "sound/%s"sound)
            
precache_generic(sound)
        }
        else
            
precache_sound(sound)
    }
}

// Deathmatch module's player respawn forward
public zp_fw_deathmatch_respawn_pre(id)
{
    
// Respawning allowed?
    
if (!get_pcvar_num(cvar_sniper_allow_respawn))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
zp_fw_core_spawn_post(id)
{
    
// Always respawn as human on sniper rounds
    
zp_core_respawn_as_zombie(idfalse)
}

public 
zp_fw_gamemodes_choose_pre(game_mode_idskipchecks)
{
    if (!
skipchecks)
    {
        
// Random chance
        
if (random_num(1get_pcvar_num(cvar_sniper_chance)) != 1)
            return 
PLUGIN_HANDLED;
        
        
// Min players
        
if (GetAliveCount() < get_pcvar_num(cvar_sniper_min_players))
            return 
PLUGIN_HANDLED;
    }
    
    
// Game mode allowed
    
return PLUGIN_CONTINUE;
}

public 
zp_fw_gamemodes_choose_post(game_mode_idtarget_player)
{
    
// Pick player randomly?
    
g_TargetPlayer = (target_player == RANDOM_TARGET_PLAYER) ? GetRandomAlive(random_num(1GetAliveCount())) : target_player
}

public 
zp_fw_gamemodes_start()
{
    
// Turn player into sniper
    
zp_class_sniper_set(g_TargetPlayer)
    
    
// Turn the remaining players into zombies
    
new id
    
for (id 1id <= g_MaxPlayersid++)
    {
        
// Not alive
        
if (!is_user_alive(id))
            continue;
        
        
// sniper or already a zombie
        
if (zp_class_sniper_get(id) || zp_core_is_zombie(id))
            continue;
        
        
zp_core_infect(id)
    }
    
    
// Play sniper sound
    
if (get_pcvar_num(cvar_sniper_sounds))
    {
        new 
sound[SOUND_MAX_LENGTH]
        
ArrayGetString(g_sound_sniperrandom_num(0ArraySize(g_sound_sniper) - 1), soundcharsmax(sound))
        
PlaySoundToClients(sound)
    }
    
    if (
get_pcvar_num(cvar_sniper_show_hud))
    {
        
// Show sniper HUD notice
        
new name[32]
        
get_user_name(g_TargetPlayernamecharsmax(name))
        
set_hudmessage(HUD_EVENT_RHUD_EVENT_GHUD_EVENT_BHUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_HudSync"%L"LANG_PLAYER"NOTICE_SNIPER"name)
    }
}

// Plays a sound on clients
PlaySoundToClients(const sound[])
{
    if (
equal(sound[strlen(sound)-4], ".mp3"))
        
client_cmd(0"mp3 play ^"sound/%s^""sound)
    else
        
client_cmd(0"spk ^"%s^""sound)
}

// Get Alive Count -returns alive players number-
GetAliveCount()
{
    new 
iAliveid
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (
is_user_alive(id))
            
iAlive++
    }
    
    return 
iAlive;
}

// Get Random Alive -returns index of alive player number target_index -
GetRandomAlive(target_index)
{
    new 
iAliveid
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (
is_user_alive(id))
            
iAlive++
        
        if (
iAlive == target_index)
            return 
id;
    }
    
    return -
1;

__________________

Last edited by B7PK; 06-02-2016 at 16:20.
B7PK is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 06-04-2016 , 16:29   Re: help sniper mode
Reply With Quote #2

Try..
PHP Code:
 // sniper or already a zombie
        
if (zp_class_sniper_get(id) || zp_core_is_zombie(id))
            continue;
        
        
zp_core_infect(id
>>>
PHP Code:
 // sniper or already a zombie
        
if (zp_class_sniper_get(id) || zp_class_nemesis_get(id))
            continue;
        
        
zp_class_nemesis_set(id
KiLLeR. is offline
B7PK
Member
Join Date: Apr 2016
Location: palestine
Old 06-05-2016 , 13:16   Re: help sniper mode
Reply With Quote #3

Error complete:
PHP Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c1997-2013 ITB CompuPhaseAMX Mod X Team

Error
Undefined symbol "GetAliveCount" on line 117
Error
Undefined symbol "GetRandomAlive" on line 128
Error
Undefined symbol "zp_class_nemesis_get" on line 145
Error
Undefined symbol "zp_class_nemesis_set" on line 148
Warning
Loose indentation on line 151
Error
Undefined symbol "PlaySoundToClients" on line 155
Warning
Loose indentation on line 169
Error
Undefined symbol "PlaySoundToClients" on line 169
Error
Invalid expressionassumed zero on line 169
Error
Undefined symbol "sound" on line 169
Error
Too many error messages on one line on line 169

Compilation aborted
.
9 Errors.
Could not locate output file C:\Users\MaDNeSS\Desktop\zoz_gamemod_Sniper.amx (compile failed). 
__________________
B7PK is offline
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 06-05-2016 , 13:22   Re: help sniper mode
Reply With Quote #4

include the class mate

Code:
#include <zp50_class_nemesis>
Whitez is offline
B7PK
Member
Join Date: Apr 2016
Location: palestine
Old 06-05-2016 , 16:15   Re: help sniper mode
Reply With Quote #5

Error
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "GetAliveCount" on line 118
Error: Undefined symbol "GetRandomAlive" on line 129
Warning: Loose indentation on line 152
Error: Undefined symbol "PlaySoundToClients" on line 156
Warning: Loose indentation on line 170
Error: Undefined symbol "PlaySoundToClients" on line 170
Error: Invalid expression, assumed zero on line 170
Error: Undefined symbol "sound" on line 170
Error: Too many error messages on one line on line 170

Compilation aborted.
7 Errors.
__________________
B7PK is offline
B7PK
Member
Join Date: Apr 2016
Location: palestine
Old 06-05-2016 , 17:06   Re: help sniper mode
Reply With Quote #6

I'll Fixed Don.
__________________
B7PK 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 00:28.


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