Raised This Month: $51 Target: $400
 12% 

Bug Report Help Sniper vs assatin Bug


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Toni1
Member
Join Date: Sep 2016
Location: Kosova
Old 09-01-2016 , 15:07   Help Sniper vs assatin Bug
Reply With Quote #1

Help pelase iam goind bugs from this game modes

Bug Erros

PHP Code:
[AMXXDisplaying debug trace (plugin "zp50_gamemode_sva_round.amxx")
L 09/01/2016 13:45:02: [AMXXRun time error 10native error (native "zp_class_sniper_get")
L 09/01/2016 13:45:02: [AMXX]    [0zp50_gamemode_sva_round.sma::fw_TakeDamage (line 153
My Code SNiper Vs Assatin

PHP Code:
#include <amxmodx>
#include <fun>
#include <amx_settings_api>
#include <cs_teams_api>
#include <zp50_gamemodes>
#include <zp50_class_sniper>
#include <zp50_class_assassin>
#include <zp50_deathmatch>
#include <hamsandwich>

#define HUD_EVENT_X -1.0
#define HUD_EVENT_Y 0.17
#define HUD_EVENT_R 0
#define HUD_EVENT_G 50
#define HUD_EVENT_B 200

new g_MaxPlayers
new g_HudSync
new g_LValue[2]

new 
cvar_sva_chancecvar_sva_min_players
new cvar_sva_ratio
new cvar_sva_sniper_hp_multicvar_sva_assassin_hp_multi
new cvar_sva_show_hud
new cvar_sva_allow_respawn
new g_damage_increase

public plugin_precache()
{
    
register_plugin("[ZP] Game Mode: Sniper vs Assassin"ZP_VERSION_STRING"zmd94")
    
zp_gamemodes_register("Sniper vs Assassin")
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
g_HudSync CreateHudSyncObj()
    
    
g_MaxPlayers get_maxplayers()
    
    
cvar_sva_chance register_cvar("zp_sva_chance""20")
    
cvar_sva_min_players register_cvar("zp_sva_min_players""0")
    
cvar_sva_ratio register_cvar("zp_sva_ratio""0.5")
    
cvar_sva_sniper_hp_multi register_cvar("zp_sva_sniper_hp_multi""0.25")
    
cvar_sva_assassin_hp_multi register_cvar("zp_sva_assassin_hp_multi""0.25")
    
cvar_sva_show_hud register_cvar("zp_sva_show_hud""1")
    
cvar_sva_allow_respawn register_cvar("zp_sva_allow_respawn""0")
    
g_damage_increase register_cvar("zp_damage_increase""99.0")
}

public 
zp_fw_deathmatch_respawn_pre(id)
{
    if (!
get_pcvar_num(cvar_sva_allow_respawn))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
zp_fw_gamemodes_choose_pre(game_mode_idskipchecks)
{
    if (!
skipchecks)
    {
        if (
random_num(1get_pcvar_num(cvar_sva_chance)) != 1)
            return 
PLUGIN_HANDLED;
        
        if (
GetAliveCount() < get_pcvar_num(cvar_sva_min_players))
            return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}

public 
zp_fw_gamemodes_start()
{
    new 
idalive_count GetAliveCount()
    new 
sniper_count floatround(alive_count get_pcvar_float(cvar_sva_ratio), floatround_ceil)
    new 
assassin_count alive_count sniper_count
    
    
new iSnipersiMaxSnipers sniper_count
    
while (iSnipers iMaxSnipers)
    {
        
id GetRandomAlive(random_num(1alive_count))
        
        if (
zp_class_sniper_get(id))
            continue;
        
        
zp_class_sniper_set(id)
        
iSnipers++
        
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_sva_sniper_hp_multi)))
    }
    new 
iAssassiniMaxAssassin assassin_count
    
while (iAssassin iMaxAssassin)
    {
        
id GetRandomAlive(random_num(1alive_count))
        
        if (
zp_class_sniper_get(id) || zp_class_assassin_get(id))
            continue;
        
        
zp_class_assassin_set(id)
        
iAssassin++
        
        
set_user_health(idfloatround(get_user_health(id) * get_pcvar_float(cvar_sva_assassin_hp_multi)))
    }
    
    if (
get_pcvar_num(cvar_sva_show_hud))
    {
        
set_hudmessage(HUD_EVENT_RHUD_EVENT_GHUD_EVENT_BHUD_EVENT_XHUD_EVENT_Y10.05.01.01.0, -1)
        
ShowSyncHudMsg(0g_HudSync"Sniper vs Assassin Round!")
    }
    
    
// Setting Dark Lightning For The Mode
    
get_cvar_string "zp_lighting"g_LValue )
    if ( !
equali"g_LValue" "a" ))
    {

        
set_cvar_string "zp_lighting" "a" )

    }
}

GetAliveCount()
{
    new 
iAliveid
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (
is_user_alive(id))
            
iAlive++
    }
    
    return 
iAlive;
}

GetRandomAlive(target_index)
{
    new 
iAliveid
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (
is_user_alive(id))
            
iAlive++
        
        if (
iAlive == target_index)
            return 
id;
    }
    
    return -
1;
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type
{    
    if(
victim == attacker)
        return 
HAM_IGNORED
        
    
else if(zp_class_sniper_get(attacker)) 
    {
        
damage *= get_pcvar_float(g_damage_increase)
        
SetHamParamFloat(4damage)
    }
    return 
HAM_IGNORED
}

public 
zp_fw_gamemodes_end()
{
    
// Setting The lighting Settings as before the Mode.
    
set_cvar_string "zp_lighting" "d" )

Toni1 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 09-01-2016 , 16:26   Re: Help Sniper vs assatin Bug
Reply With Quote #2

Code:
else if(zp_class_sniper_get(attacker))
-->
Code:
else if(is_user_alive(attacker) && zp_class_sniper_get(attacker))
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Toni1
Member
Join Date: Sep 2016
Location: Kosova
Old 09-02-2016 , 03:01   Re: Help Sniper vs assatin Bug
Reply With Quote #3

Thanks Fixed
Toni1 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 05:40.


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