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

[CSGO]The ZHR plugin has encountered an error.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
2389736818
Member
Join Date: Jul 2014
Location: China
Old 10-29-2016 , 11:25   [CSGO]The ZHR plugin has encountered an error.
Reply With Quote #1

log:
L 10/29/2016 - 23:192: SourceMod error session started
L 10/29/2016 - 23:192: Info (map "de_dust2") (file "errors_20161029.log")
L 10/29/2016 - 23:192: [SDKTOOLS] Invalid detour address passed - Disabling detour to prevent crashes
L 10/29/2016 - 23:19:58: [UPDATER] --- BEGIN ERRORS FROM AUTOMATIC UPDATER ---
L 10/29/2016 - 23:19:58: [UPDATER] Could not download "http://update.sourcemod.net/update/"
L 10/29/2016 - 23:19:58: [UPDATER] Error: Could not resolve host: update.sourcemod.net; Host not found, try again
L 10/29/2016 - 23:19:58: [UPDATER] --- END ERRORS FROM AUTOMATIC UPDATER ---
L 10/29/2016 - 23:204: [SM] Exception reported: Property "m_iScore" not found (entity 67/cs_team_manager)
L 10/29/2016 - 23:204: [SM] Blaming: zhr.smx
L 10/29/2016 - 23:204: [SM] Call stack trace:
L 10/29/2016 - 23:204: [SM] [0] SetEntProp
L 10/29/2016 - 23:204: [SM] [1] Line 155, H:\csgo_ds\csgo\addons\sourcemod\scripting\in clude\swapteam.inc::_SetTeamScore
L 10/29/2016 - 23:204: [SM] [2] Line 92, H:\csgo_ds\csgo\addons\sourcemod\scripting\in clude\swapteam.inc::ev_round_end
L 10/29/2016 - 23:205: [SM] Exception reported: Property "m_iScore" not found (entity 67/cs_team_manager)
L 10/29/2016 - 23:205: [SM] Blaming: zhr.smx
L 10/29/2016 - 23:205: [SM] Call stack trace:
L 10/29/2016 - 23:205: [SM] [0] SetEntProp
L 10/29/2016 - 23:205: [SM] [1] Line 155, H:\csgo_ds\csgo\addons\sourcemod\scripting\in clude\swapteam.inc::_SetTeamScore
L 10/29/2016 - 23:205: [SM] [2] Line 47, H:\csgo_ds\csgo\addons\sourcemod\scripting\in clude\swapteam.inc::ev_round_start
L 10/29/2016 - 23:20:51: [SM] Exception reported: Property "m_iScore" not found (entity 67/cs_team_manager)
L 10/29/2016 - 23:20:51: [SM] Blaming: zhr.smx
L 10/29/2016 - 23:20:51: [SM] Call stack trace:
L 10/29/2016 - 23:20:51: [SM] [0] SetEntProp
L 10/29/2016 - 23:20:51: [SM] [1] Line 155, H:\csgo_ds\csgo\addons\sourcemod\scripting\in clude\swapteam.inc::_SetTeamScore
L 10/29/2016 - 23:20:51: [SM] [2] Line 47, H:\csgo_ds\csgo\addons\sourcemod\scripting\in clude\swapteam.inc::ev_round_start

PHP Code:
new Handle:cvar_zx2_swapteam_round;
new 
Handle:cvar_mp_restartgame;
new 
g_round;
new 
g_score_ct;
new 
g_score_t;
new 
bool:IsSwap;
new 
g_team_side;
new 
m_iScore;
new 
bool:IsBlockSwitchTeam[MAXPLAYERS+1];
new 
count2=0;

public 
Cvar_mp_restartgame(Handle:cvar, const String:oldvalue[], const String:newvalue[])
{
    if(
cvar_mp_restartgame != INVALID_HANDLE)
    {
        if(
StringToInt(newvalue) > 0)
        {
            
g_score_t 0;
            
g_score_ct 0;
            
g_round 0;
            
IsSwap false;
        }
    }
}
public 
Action:ev_player_team(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl client;
    
client GetClientOfUserId(GetEventInt(event"userid"));
    if(
client 0)
    {
        if(
IsBlockSwitchTeam[client])
        {
            
IsBlockSwitchTeam[client] = false;
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;
}
public 
ev_round_start(Handle:event, const String:name[], bool:dontBroadcast)
{
    
g_round++;
    if(
g_team_side == CS_TEAM_CT)
    {
        
_SetTeamScore(CS_TEAM_CT,g_score_ct);
        
_SetTeamScore(CS_TEAM_T,g_score_t);
    } else if(
g_team_side == CS_TEAM_T) {
        
_SetTeamScore(CS_TEAM_T,g_score_ct);
        
_SetTeamScore(CS_TEAM_CT,g_score_t);
    }
}
public 
ev_round_freeze_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl max_round;
    
max_round GetConVarInt(cvar_zx2_swapteam_round);
    if(
max_round <= 0)
    {
        return;
    }
    if(
g_round >= max_round)
    {
        
count2++;
        if (
count2 == 1)
        {
        
IsSwap true;
        
PrintToChatAll("\x05[ZHR]\x01 Round %d, Teams will be swapped at the end of this round!",g_round);
        
EmitSoundToAll("ambient/misc/brass_bell_C.wav");
        }
    } else {
        
PrintToChatAll("\x05[ZHR]\x01 Round %d",g_round);
    }
    
PrintCenterTextAll("[ZHR] Round %d/%d",g_round,max_round);
}
public 
ev_round_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl reason;
    
reason GetEventInt(event"reason");
    
decl winner;
    
winner GetEventInt(event"winner");
    if(
winner == 3)
    {
        if(
g_team_side == CS_TEAM_CTg_score_ct++;
        if(
g_team_side == CS_TEAM_Tg_score_t++;
    } else if(
winner == 2) {
        if(
g_team_side == CS_TEAM_Tg_score_ct++;
        if(
g_team_side == CS_TEAM_CTg_score_t++;
    }
    if(
g_team_side == CS_TEAM_CT)
    {
        
_SetTeamScore(CS_TEAM_CT,g_score_ct);
        
_SetTeamScore(CS_TEAM_T,g_score_t);
    } else if(
g_team_side == CS_TEAM_T) {
        
_SetTeamScore(CS_TEAM_T,g_score_ct);
        
_SetTeamScore(CS_TEAM_CT,g_score_t);
    }
    if(
IsSwap)
    {
        if (
count2 == 1)
        {
            
SwapTeam();
            
g_round 0;
            
IsSwap false;
            if(
g_team_side == CS_TEAM_CT)
            {
                
g_team_side CS_TEAM_T;
            } else {
                
g_team_side CS_TEAM_CT;
            }
            
PrintToChatAll("\x05[ZHR]\x01 Score Swaped");
        }
    }
    if(
reason == 16)
    {
        
g_score_t 0;
        
g_score_ct 0;
        
g_round 0;
        
IsSwap false;
    }
}
stock SwapTeam()
{
    
decl maxclient,i,team;
    
maxclient GetMaxClients();
    
EmitSoundToAll("ambient/misc/brass_bell_C.wav");
    for(
i=1;i<=maxclient;i++)
    {
        if(
IsClientInGame(i))
        {
            
team GetClientTeam(i);
            if(
team == CS_TEAM_CT)
            {
                
IsBlockSwitchTeam[i] = true;
                
CS_SwitchTeam(i,CS_TEAM_T);
                if(
IsPlayerAlive(i))
                {
                }
            } else if(
team == CS_TEAM_T) {
                
IsBlockSwitchTeam[i] = true;
                
CS_SwitchTeam(i,CS_TEAM_CT);
                if(
IsPlayerAlive(i))
                {
                }
            }
        }
    }
    
PrintToChatAll("\x04[ZHR] Team Swaped");
}
public 
bool:_SetTeamScore(indexvalue)
{
    new 
team MAXPLAYERS 1;
    
team FindEntityByClassname(-1"cs_team_manager");
    while (
team != -1)
    {
        if (
GetEntProp(teamProp_Send"m_iTeamNum"1) == index)
        {
            
SetEntProp(teamProp_Send"m_iScore"value4);
            
ChangeEdictState(teamm_iScore);
            return 
true;
        }
        
team FindEntityByClassname(team"cs_team_manager");
    }
    return 
false;

How can I modify ?
__________________

Last edited by 2389736818; 10-29-2016 at 11:28.
2389736818 is offline
2389736818
Member
Join Date: Jul 2014
Location: China
Old 10-29-2016 , 19:42   Re: [CSGO]The ZHR plugin has encountered an error.
Reply With Quote #2

The attribute "m_iScore" Where is the need to set ?
__________________
2389736818 is offline
2389736818
Member
Join Date: Jul 2014
Location: China
Old 10-29-2016 , 20:23   Re: [CSGO]The ZHR plugin has encountered an error.
Reply With Quote #3

This can be done ?

PHP Code:
new Handle:cvar_zx2_swapteam_round;
new 
Handle:cvar_mp_restartgame;
new 
g_round;
new 
g_score_ct;
new 
g_score_t;
new 
bool:IsSwap;
new 
g_team_side;
new 
m_iScore;
new 
bool:IsBlockSwitchTeam[MAXPLAYERS+1];
new 
count2=0;

public 
Cvar_mp_restartgame(Handle:cvar, const String:oldvalue[], const String:newvalue[])
{
    if(
cvar_mp_restartgame != INVALID_HANDLE)
    {
        if(
StringToInt(newvalue) > 0)
        {
            
g_score_t 0;
            
g_score_ct 0;
            
g_round 0;
            
IsSwap false;
        }
    }
}
public 
Action:ev_player_team(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl client;
    
client GetClientOfUserId(GetEventInt(event"userid"));
    if(
client 0)
    {
        if(
IsBlockSwitchTeam[client])
        {
            
IsBlockSwitchTeam[client] = false;
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;
}
public 
Action Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
g_round++;
    if(
g_team_side == CS_TEAM_CT)
    {
        
_SetTeamScore(CS_TEAM_CT,g_score_ct);
        
_SetTeamScore(CS_TEAM_T,g_score_t);
    } else if(
g_team_side == CS_TEAM_T) {
        
_SetTeamScore(CS_TEAM_T,g_score_ct);
        
_SetTeamScore(CS_TEAM_CT,g_score_t);
    }
}
public 
ev_round_freeze_end(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl max_round;
    
max_round GetConVarInt(cvar_zx2_swapteam_round);
    if(
max_round <= 0)
    {
        return;
    }
    if(
g_round >= max_round)
    {
        
count2++;
        if (
count2 == 1)
        {
        
IsSwap true;
        
PrintToChatAll("\x05[ZHR]\x01 Round %d, Teams will be swapped at the end of this round!",g_round);
        
EmitSoundToAll("ambient/misc/brass_bell_C.wav");
        }
    } else {
        
PrintToChatAll("\x05[ZHR]\x01 Round %d",g_round);
    }
    
PrintCenterTextAll("[ZHR] Round %d/%d",g_round,max_round);
}
public 
Action Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl reason;
    
reason GetEventInt(event"reason");
    
decl winner;
    
winner GetEventInt(event"winner");
    if(
winner == 3)
    {
        if(
g_team_side == CS_TEAM_CTg_score_ct++;
        if(
g_team_side == CS_TEAM_Tg_score_t++;
    } else if(
winner == 2) {
        if(
g_team_side == CS_TEAM_Tg_score_ct++;
        if(
g_team_side == CS_TEAM_CTg_score_t++;
    }
    if(
g_team_side == CS_TEAM_CT)
    {
        
_SetTeamScore(CS_TEAM_CT,g_score_ct);
        
_SetTeamScore(CS_TEAM_T,g_score_t);
    } else if(
g_team_side == CS_TEAM_T) {
        
_SetTeamScore(CS_TEAM_T,g_score_ct);
        
_SetTeamScore(CS_TEAM_CT,g_score_t);
    }
    if(
IsSwap)
    {
        if (
count2 == 1)
        {
            
SwapTeam();
            
g_round 0;
            
IsSwap false;
            if(
g_team_side == CS_TEAM_CT)
            {
                
g_team_side CS_TEAM_T;
            } else {
                
g_team_side CS_TEAM_CT;
            }
            
PrintToChatAll("\x05[ZHR]\x01 Score Swaped");
        }
    }
    if(
reason == 16)
    {
        
g_score_t 0;
        
g_score_ct 0;
        
g_round 0;
        
IsSwap false;
    }
}
stock SwapTeam()
{
    
decl maxclient,i,team;
    
maxclient GetMaxClients();
    
EmitSoundToAll("ambient/misc/brass_bell_C.wav");
    for(
i=1;i<=maxclient;i++)
    {
        if(
IsClientInGame(i))
        {
            
team GetClientTeam(i);
            if(
team == CS_TEAM_CT)
            {
                
IsBlockSwitchTeam[i] = true;
                
CS_SwitchTeam(i,CS_TEAM_T);
                if(
IsPlayerAlive(i))
                {
                }
            } else if(
team == CS_TEAM_T) {
                
IsBlockSwitchTeam[i] = true;
                
CS_SwitchTeam(i,CS_TEAM_CT);
                if(
IsPlayerAlive(i))
                {
                }
            }
        }
    }
    
PrintToChatAll("\x04[ZHR] Team Swaped");
}
public 
bool:_SetTeamScore(indexvalue)
{
    new 
team MAXPLAYERS 1;
    
team FindEntityByClassname(-1"cs_team_manager");
    while (
team != -1)
    {
        if (
GetEntProp(teamProp_Send"m_iTeamNum"1) == index)
        {
            
SetEntProp(teamProp_Send"m_iScore"value4);
            
ChangeEdictState(teamm_iScore);
            return 
true;
        }
        
team FindEntityByClassname(team"cs_team_manager");
    }
    return 
false;

PHP Code:
    // Hooks
    
HookEvent("round_freeze_end",ev_round_freeze_end);
    
HookEvent("round_freeze_end",zhr_round_freeze_end);
    
HookEvent("round_end"Event_RoundStart);
    
HookEvent("round_start",Event_RoundEnd);
    
HookEventEx("round_start"CleanupEventHookMode_Post);
    
HookEvent("player_team",ev_player_team,EventHookMode_Pre);
    
HookEvent("player_spawn"Event_spawnEventHookMode_Pre);
    
HookEvent("player_death"Event_Death);
    
HookEvent("player_hurt"EventPlayerHurtEventHookMode_Pre);
    
HookEvent("item_pickup"event_pickup);
    
HookConVarChange(cvar_mp_restartgame,Cvar_mp_restartgame); 
__________________

Last edited by 2389736818; 10-29-2016 at 20:27.
2389736818 is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 10-30-2016 , 11:01   Re: [CSGO]The ZHR plugin has encountered an error.
Reply With Quote #4

If my memory serves correct, there were/are other functions that are used to change a player's score. if I remember, I was the one who asked help for it.

Also, are you using the latest SM? I wonder why SDKTools is acting like that.

EDIT: Found my post. The function is this

Last edited by cravenge; 10-30-2016 at 11:09.
cravenge 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 21:14.


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