Raised This Month: $32 Target: $400
 8% 

Subplugin Submission [ZP]5.0.8 Sniper & Assassin [FIX]


Post New Thread Reply   
 
Thread Tools Display Modes
badalhoca
Senior Member
Join Date: Sep 2009
Old 12-23-2012 , 12:54   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #111

Because of me espadogaming fix it, i almost knocked at his door at romenia
Ty so much for helping me at my server!
badalhoca is offline
fr6
Junior Member
Join Date: Jan 2013
Location: Serbia Kragujevac
Old 01-03-2013 , 13:47   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #112

I have a little problem on my server : check it out
-------------------------------------------------------------------------------------------
L 01/03/2013 - 19:43:08: [FAKEMETA] Invalid entity
L 01/03/2013 - 19:43:08: [AMXX] Displaying debug trace (plugin "zp50_buy_zones.amxx")
L 01/03/2013 - 19:43:08: [AMXX] Run time error 10: native error (native "dllfunc")
L 01/03/2013 - 19:43:08: [AMXX] [0] zp50_buy_zones.sma::fw_PlayerPreThink (line 244)
-------------------------------------------------------------------------------------------
always same and same , please fix it I'm try but it says something like no wat to point include or other...

a little fix will be good
fr6 is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 01-03-2013 , 15:11   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #113

Quote:
Originally Posted by fr6 View Post
I have a little problem on my server : check it out
-------------------------------------------------------------------------------------------
L 01/03/2013 - 19:43:08: [FAKEMETA] Invalid entity
L 01/03/2013 - 19:43:08: [AMXX] Displaying debug trace (plugin "zp50_buy_zones.amxx")
L 01/03/2013 - 19:43:08: [AMXX] Run time error 10: native error (native "dllfunc")
L 01/03/2013 - 19:43:08: [AMXX] [0] zp50_buy_zones.sma::fw_PlayerPreThink (line 244)
-------------------------------------------------------------------------------------------
always same and same , please fix it I'm try but it says something like no wat to point include or other...

a little fix will be good
show the output of meta list.
XINLEI is offline
fr6
Junior Member
Join Date: Jan 2013
Location: Serbia Kragujevac
Old 01-04-2013 , 06:16   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #114

-------------------------------------------------------------------------------------------
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.1.3 ini Start ANY
[ 2] Fun RUN - fun_amxx.dll v1.75 pl1 ANY ANY
[ 3] CSX RUN - csx_amxx.dll v1.75 pl1 ANY ANY
[ 4] CStrike RUN - cstrike_amxx.dll v1.75 pl1 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx.dl v1.75 pl1 ANY ANY
[ 6] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl1 ANY ANY
[ 7] Engine RUN - engine_amxx.dll v1.75 pl1 ANY ANY
[ 8] CSDM2 RUN - csdm_amxx.dll v2.1.2 pl1 ANY
-------------------------------------------------------------------------------------------

If you think on support & modules I have at all newest for win32 , amx 1.8.1 + super 4.2 + zp 5.0.8 of course and this mode Assassin&Sniper.

Last edited by fr6; 01-04-2013 at 06:17.
fr6 is offline
XINLEI
me too
Join Date: Jun 2011
Location: Colombian Coffee storage
Old 01-04-2013 , 14:28   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #115

Quote:
Originally Posted by fr6 View Post
-------------------------------------------------------------------------------------------
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.1.3 ini Start ANY
[ 2] Fun RUN - fun_amxx.dll v1.75 pl1 ANY ANY
[ 3] CSX RUN - csx_amxx.dll v1.75 pl1 ANY ANY
[ 4] CStrike RUN - cstrike_amxx.dll v1.75 pl1 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx.dl v1.75 pl1 ANY ANY
[ 6] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl1 ANY ANY
[ 7] Engine RUN - engine_amxx.dll v1.75 pl1 ANY ANY
[ 8] CSDM2 RUN - csdm_amxx.dll v2.1.2 pl1 ANY
-------------------------------------------------------------------------------------------

If you think on support & modules I have at all newest for win32 , amx 1.8.1 + super 4.2 + zp 5.0.8 of course and this mode Assassin&Sniper.
Your Amxx is outdated. Look mine:

---------------------------------------------------------------------------------
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.1.3 ini Start ANY
[ 2] Fun RUN - fun_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 3] CStrike RUN - cstrike_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 4] CSX RUN - csx_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 5] Engine RUN - engine_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx.dl v1.8.1.3 pl2 ANY ANY
[ 7] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl2 ANY
----------------------------------------------------------------------------------

Last edited by XINLEI; 01-04-2013 at 14:29.
XINLEI is offline
fr6
Junior Member
Join Date: Jan 2013
Location: Serbia Kragujevac
Old 01-05-2013 , 08:12   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #116

Quote:
Originally Posted by XINLEI View Post
Your Amxx is outdated. Look mine:

---------------------------------------------------------------------------------
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.1.3 ini Start ANY
[ 2] Fun RUN - fun_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 3] CStrike RUN - cstrike_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 4] CSX RUN - csx_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 5] Engine RUN - engine_amxx.dll v1.8.1.3 pl2 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx.dl v1.8.1.3 pl2 ANY ANY
[ 7] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl2 ANY
----------------------------------------------------------------------------------
Ok you way sure.On my host that's newest but you have all up to date soon gonna download all of that versions.Thanks for remembering me .
-Now I have updated all , think gonna work good but I disabled zp50_buy_zones ...

Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.1.3 ini Start ANY
[ 2] Fun RUN - fun_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 3] CSX RUN - csx_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 4] CStrike RUN - cstrike_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 5] FakeMeta RUN - fakemeta_amxx.dl v1.8.1.3 pl1 ANY ANY
[ 6] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl1 ANY ANY
[ 7] Engine RUN - engine_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 8] CSDM2 RUN - csdm_amxx.dll v2.1.2 pl1 ANY ANY
8 plugins

Last edited by fr6; 01-05-2013 at 08:36. Reason: updated...
fr6 is offline
TheZEROts
Member
Join Date: Apr 2012
Old 03-22-2013 , 15:56   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #117

Light still doesn't change after Assassin round. Not for me, not on my server.
Can't compile zp50_gameplay_fixes.amxx.

Mod is crashing my server on regular bases, I did everything right? Could you help?
__________________

The One
The Only
TheZEROts

Last edited by TheZEROts; 04-01-2013 at 08:07.
TheZEROts is offline
arditjaha
Member
Join Date: Jul 2013
Old 07-22-2013 , 15:48   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #118

How can I change the damage level of sniper ? The idea of sniper is one shot one kill but here in this plugin it's just normal sniper
arditjaha is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 07-22-2013 , 17:33   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #119

Try this..

PHP Code:
/*================================================================================
    
    ----------------------------
    -*- [ZP] Class: 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 <fun>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <amx_settings_api>
#include <cs_maxspeed_api>
#include <cs_player_models_api>
#include <cs_weap_models_api>
#include <cs_ham_bots_api>
#include <zp50_core>
#include <zp50_items>

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

// Default models
new const models_sniper_player[][] = { "leet""sas" }

new Array:
g_models_sniper_player

#define PLAYERMODEL_MAX_LENGTH 32
#define MODEL_MAX_LENGTH 64

new g_models_sniper_weapon[MODEL_MAX_LENGTH] = "models/v_awp.mdl"

#define TASK_AURA 100
#define ID_AURA (taskid - TASK_AURA)

#define flag_get(%1,%2) (%1 & (1 << (%2 & 31)))
#define flag_get_boolean(%1,%2) (flag_get(%1,%2) ? true : false)
#define flag_set(%1,%2) %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2) %1 &= ~(1 << (%2 & 31))

// CS Player CBase Offsets (win32)
const PDATA_SAFE 2
const OFFSET_ACTIVE_ITEM 373

// Weapon bitsums
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const 
SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
const 
GRENADES_WEAPONS_BIT_SUM = (1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE)

// Ammo Type Names for weapons
new const AMMOTYPE[][] = { """357sig""""762nato""""buckshot""""45acp""556nato""""9mm""57mm""45acp",
            
"556nato""556nato""556nato""45acp""9mm""338magnum""9mm""556natobox""buckshot",
            
"556nato""9mm""762nato""""50ae""556nato""762nato""""57mm" }

// Max BP ammo for weapons
new const MAXBPAMMO[] = { -152, -1901321100901120100100909090100120,
            
301202003290120902359090, -1100 }

#define PRIMARY_ONLY 1
#define SECONDARY_ONLY 2
#define GRENADES_ONLY 4

new g_MaxPlayers
new g_IsSniper

new cvar_sniper_healthcvar_sniper_base_healthcvar_sniper_speedcvar_sniper_gravity
new cvar_sniper_glow
new cvar_sniper_auracvar_sniper_aura_color_Rcvar_sniper_aura_color_Gcvar_sniper_aura_color_B
new cvar_sniper_weaponcvar_sniper_weapon_block


public plugin_init()
{
    
register_plugin("[ZP] Class: Sniper"ZP_VERSION_STRING"ZP Dev Team")
    
    
register_clcmd("drop""clcmd_drop")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon")
    
RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon")
    
RegisterHam(Ham_Touch"weapon_shield""fw_TouchWeapon")
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHamBots(Ham_Killed"fw_PlayerKilled")
    
register_forward(FM_ClientDisconnect"fw_ClientDisconnect_Post"1)
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_sniper_health register_cvar("zp_sniper_health""0")
    
cvar_sniper_base_health register_cvar("zp_sniper_base_health""100")
    
cvar_sniper_speed register_cvar("zp_sniper_speed""0.95")
    
cvar_sniper_gravity register_cvar("zp_sniper_gravity""0.75")
    
cvar_sniper_glow register_cvar("zp_sniper_glow""1")
    
cvar_sniper_aura register_cvar("zp_sniper_aura""0")
    
cvar_sniper_aura_color_R register_cvar("zp_sniper_aura_color_R""200")
    
cvar_sniper_aura_color_G register_cvar("zp_sniper_aura_color_G""200")
    
cvar_sniper_aura_color_B register_cvar("zp_sniper_aura_color_B""0")
    
cvar_sniper_weapon register_cvar("zp_sniper_weapon""weapon_awp")
    
cvar_sniper_weapon_block register_cvar("zp_sniper_weapon_block""1")
    
}

public 
plugin_precache()
{
    
// Initialize arrays
    
g_models_sniper_player ArrayCreate(PLAYERMODEL_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Player Models""SNIPER"g_models_sniper_player)
    
    
// If we couldn't load from file, use and save default ones
    
new index
    
if (ArraySize(g_models_sniper_player) == 0)
    {
        for (
index 0index sizeof models_sniper_playerindex++)
            
ArrayPushString(g_models_sniper_playermodels_sniper_player[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Player Models""SNIPER"g_models_sniper_player)
    }
    
    
// Load from external file, save if not found
    
if (!amx_load_setting_string(ZP_SETTINGS_FILE"Weapon Models""V_WEAPON SNIPER"g_models_sniper_weaponcharsmax(g_models_sniper_weapon)))
        
amx_save_setting_string(ZP_SETTINGS_FILE"Weapon Models""V_WEAPON SNIPER"g_models_sniper_weapon)
    
    
    
// Precache models
    
new player_model[PLAYERMODEL_MAX_LENGTH], model_path[128]
    for (
index 0index ArraySize(g_models_sniper_player); index++)
    {
        
ArrayGetString(g_models_sniper_playerindexplayer_modelcharsmax(player_model))
        
formatex(model_pathcharsmax(model_path), "models/player/%s/%s.mdl"player_modelplayer_model)
        
precache_model(model_path)
        
// Support modelT.mdl files
        
formatex(model_pathcharsmax(model_path), "models/player/%s/%sT.mdl"player_modelplayer_model)
        if (
file_exists(model_path)) precache_model(model_path)
    }
    
    
precache_model(g_models_sniper_weapon)
}

public 
plugin_natives()
{
    
register_library("zp50_class_sniper")
    
register_native("zp_class_sniper_get""native_class_sniper_get")
    
register_native("zp_class_sniper_set""native_class_sniper_set")
    
register_native("zp_class_sniper_get_count""native_class_sniper_get_count")
}

public 
client_disconnect(id)
{
    if (
flag_get(g_IsSniperid))
    {
        
// Remove sniper glow
        
if (get_pcvar_num(cvar_sniper_glow))
            
set_user_rendering(id)
        
        
// Remove sniper aura
        
if (get_pcvar_num(cvar_sniper_aura))
            
remove_task(id+TASK_AURA)
    }
}

public 
fw_ClientDisconnect_Post(id)
{
    
// Reset flags AFTER disconnect (to allow checking if the player was sniper before disconnecting)
    
flag_unset(g_IsSniperid)
}

public 
clcmd_drop(id)
{
    
// Should sniper stick to his weapon?
    
if (flag_get(g_IsSniperid) && get_pcvar_num(cvar_sniper_weapon_block))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

// Ham Weapon Touch Forward
public fw_TouchWeapon(weaponid)
{
    
// Should sniper stick to his weapon?
    
if (get_pcvar_num(cvar_sniper_weapon_block) && is_user_alive(id) && flag_get(g_IsSniperid))
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

// Ham Player Killed Forward
public fw_PlayerKilled(victimattackershouldgib)
{
    if (
flag_get(g_IsSnipervictim))
    {
        
// Remove sniper aura
        
if (get_pcvar_num(cvar_sniper_aura))
            
remove_task(victim+TASK_AURA)
    }

    
// When killed by a Sniper victim explodes
    
if (flag_get(g_IsSniperattacker))
    {
        new 
origin[3]
        
get_user_origin(victimorigin)
        
        
message_begin(MSG_PVSSVC_TEMPENTITYorigin0)
        
write_byte(TE_LAVASPLASH)
        
write_coord(origin[0])
        
write_coord(origin[1])
        
write_coord(origin[2] - 26)
    
        
message_end()
    }
}

public 
zp_fw_core_spawn_post(id)
{
    if (
flag_get(g_IsSniperid))
    {
        
// Remove sniper glow
        
if (get_pcvar_num(cvar_sniper_glow))
            
set_user_rendering(id)
        
        
// Remove sniper aura
        
if (get_pcvar_num(cvar_sniper_aura))
            
remove_task(id+TASK_AURA)
        
        
// Remove sniper weapon model
        
new weapon_name[32]
        
get_pcvar_string(cvar_sniper_weaponweapon_namecharsmax(weapon_name))
        new 
weapon_id get_weaponid(weapon_name)
        
cs_reset_player_view_model(idweapon_id)
        
        
// Remove sniper flag
        
flag_unset(g_IsSniperid)
    }
}

public 
zp_fw_core_infect(idattacker)
{
    if (
flag_get(g_IsSniperid))
    {
        
// Remove sniper glow
        
if (get_pcvar_num(cvar_sniper_glow))
            
set_user_rendering(id)
        
        
// Remove sniper aura
        
if (get_pcvar_num(cvar_sniper_aura))
            
remove_task(id+TASK_AURA)
        
        
// Remove sniper weapon model
        
new weapon_name[32]
        
get_pcvar_string(cvar_sniper_weaponweapon_namecharsmax(weapon_name))
        new 
weapon_id get_weaponid(weapon_name)
        
cs_reset_player_view_model(idweapon_id)
        
        
// Remove sniper flag
        
flag_unset(g_IsSniperid)
    }
}

// Ham Take Damage Forward
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_alive(attacker))
        return 
HAM_IGNORED;
    
    
// Assassin attacking human
    
if (flag_get(g_IsSniperattacker) && zp_core_is_zombie(victim))
    {
        
// Ignore assassin damage override if damage comes from a 3rd party entity
        // (to prevent this from affecting a sub-plugin's rockets e.g.)
        
if (inflictor == attacker)
        {
            new 
plrWeapIdplrClipplrAmmo    
            plrWeapId 
get_user_weapon(attackerplrClipplrAmmo)
            
            if (
plrWeapId == CSW_AWP)                
                                
SetHamParamFloat(44000.0)
            
            return 
HAM_HANDLED;
        }
    }
    
    return 
HAM_IGNORED;
}

public 
zp_fw_core_cure_post(idattacker)
{
    
// Apply sniper attributes?
    
if (!flag_get(g_IsSniperid))
        return;
    
    
// Health
    
if (get_pcvar_num(cvar_sniper_health) == 0)
        
set_user_health(idget_pcvar_num(cvar_sniper_base_health) * GetAliveCount())
    else
        
set_user_health(idget_pcvar_num(cvar_sniper_health))
    
    
// Gravity
    
set_user_gravity(idget_pcvar_float(cvar_sniper_gravity))
    
    
// Speed (if value between 0 and 10, consider it a multiplier)
    
cs_set_player_maxspeed_auto(idget_pcvar_float(cvar_sniper_speed))

    
// Apply sniper player model
    
new player_model[PLAYERMODEL_MAX_LENGTH]
    
ArrayGetString(g_models_sniper_playerrandom_num(0ArraySize(g_models_sniper_player) - 1), player_modelcharsmax(player_model))
    
cs_set_player_model(idplayer_model)

    
// Apply sniper weapon model
    
new weapon_name[32]
    
get_pcvar_string(cvar_sniper_weaponweapon_namecharsmax(weapon_name))
    new 
weapon_id get_weaponid(weapon_name)
    
cs_set_player_view_model(idweapon_idg_models_sniper_weapon)
    
    
// sniper glow
    
if (get_pcvar_num(cvar_sniper_glow))
        
set_user_rendering(idkRenderFxGlowShell00255kRenderNormal25)
    
    
// sniper aura task
    
if (get_pcvar_num(cvar_sniper_aura))
        
set_task(0.1"sniper_aura"id+TASK_AURA__"b")
    
    
// Strip current weapons and give sniper weapon
    
strip_weapons(idPRIMARY_ONLY)
    
strip_weapons(idSECONDARY_ONLY)
    
strip_weapons(idGRENADES_ONLY)
    
give_item(idweapon_name)
    
ExecuteHamB(Ham_GiveAmmoidMAXBPAMMO[weapon_id], AMMOTYPE[weapon_id], MAXBPAMMO[weapon_id])
}

public 
native_class_sniper_get(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_connected(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return -
1;
    }
    
    return 
flag_get_boolean(g_IsSniperid);
}

public 
native_class_sniper_set(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_alive(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return 
false;
    }
    
    if (
flag_get(g_IsSniperid))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Player already a sniper (%d)"id)
        return 
false;
    }
    
    
flag_set(g_IsSniperid)
    
zp_core_force_cure(id)
    return 
true;
}

public 
native_class_sniper_get_count(plugin_idnum_params)
{
    return 
GetsniperCount();
}

// sniper aura task
public sniper_aura(taskid)
{
    
// Get player's origin
    
static origin[3]
    
get_user_origin(ID_AURAorigin)
    
    
// Colored Aura
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_DLIGHT// TE id
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]) // z
    
write_byte(20// radius
    
write_byte(get_pcvar_num(cvar_sniper_aura_color_R)) // r
    
write_byte(get_pcvar_num(cvar_sniper_aura_color_G)) // g
    
write_byte(get_pcvar_num(cvar_sniper_aura_color_B)) // b
    
write_byte(2// life
    
write_byte(0// decay rate
    
message_end()
}

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

// Get sniper Count -returns alive sniper number-
GetsniperCount()
{
    new 
isnipersid
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (
is_user_alive(id) && flag_get(g_IsSniperid))
            
isnipers++
    }
    
    return 
isnipers;
}

// Strip primary/secondary/grenades
stock strip_weapons(idstripwhat)
{
    
// Get user weapons
    
new weapons[32], num_weaponsindexweaponid
    get_user_weapons
(idweaponsnum_weapons)
    
    
// Loop through them and drop primaries or secondaries
    
for (index 0index num_weaponsindex++)
    {
        
// Prevent re-indexing the array
        
weaponid weapons[index]
        
        if ((
stripwhat == PRIMARY_ONLY && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
        || (
stripwhat == SECONDARY_ONLY && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))
        || (
stripwhat == GRENADES_ONLY && ((1<<weaponid) & GRENADES_WEAPONS_BIT_SUM)))
        {
            
// Get weapon name
            
new wname[32]
            
get_weaponname(weaponidwnamecharsmax(wname))
            
            
// Strip weapon and remove bpammo
            
ham_strip_weapon(idwname)
            
cs_set_user_bpammo(idweaponid0)
        }
    }
}

stock ham_strip_weapon(index, const weapon[])
{
    
// Get weapon id
    
new weaponid get_weaponid(weapon)
    if (!
weaponid)
        return 
false;
    
    
// Get weapon entity
    
new weapon_ent fm_find_ent_by_owner(-1weaponindex)
    if (!
weapon_ent)
        return 
false;
    
    
// If it's the current weapon, retire first
    
new current_weapon_ent fm_cs_get_current_weapon_ent(index)
    new 
current_weapon pev_valid(current_weapon_ent) ? cs_get_weapon_id(current_weapon_ent) : -1
    
if (current_weapon == weaponid)
        
ExecuteHamB(Ham_Weapon_RetireWeaponweapon_ent)
    
    
// Remove weapon from player
    
if (!ExecuteHamB(Ham_RemovePlayerItemindexweapon_ent))
        return 
false;
    
    
// Kill weapon entity and fix pev_weapons bitsum
    
ExecuteHamB(Ham_Item_Killweapon_ent)
    
set_pev(indexpev_weaponspev(indexpev_weapons) & ~(1<<weaponid))
    return 
true;
}

// Find entity by its owner (from fakemeta_util)
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) { /* keep looping */ }
    return 
entity;
}

// Get User Current Weapon Entity
stock fm_cs_get_current_weapon_ent(id)
{
    
// Prevent server crash if entity's private data not initalized
    
if (pev_valid(id) != PDATA_SAFE)
        return -
1;
    
    return 
get_pdata_cbase(idOFFSET_ACTIVE_ITEM);

if u want to change the damage change this SetHamParamFloat(4, 4000.0) --> this part 4000.0 and change to your damage (dont remove the .0 cuz is a float)

P.S: with each shot the damage will be the same no matter if you get to different parts of the body, the damage will be the same ..

Last edited by wicho; 07-22-2013 at 17:36.
wicho is offline
arditjaha
Member
Join Date: Jul 2013
Old 07-23-2013 , 11:56   Re: [ZP]5.0.8 Sniper & Assassin [FIX]
Reply With Quote #120

Quote:
Originally Posted by wicho View Post
if u want to change the damage change this SetHamParamFloat(4, 4000.0) --> this part 4000.0 and change to your damage (dont remove the .0 cuz is a float)

P.S: with each shot the damage will be the same no matter if you get to different parts of the body, the damage will be the same ..
Can't find it . Can you please edit it to 100000.0 ? I will appreciate it
arditjaha is offline
Reply


Thread Tools
Display Modes

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 15:34.


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