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

[NEEDHELP]Error deathrun manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NickischLP
Senior Member
Join Date: Jun 2013
Location: Germany
Old 08-31-2015 , 14:28   [NEEDHELP]Error deathrun manager
Reply With Quote #1

I need help to get the plugin runing on my server.
I get this error in my serverlog:
Code:
L 08/31/2015 - 14:09:00: [SM] Native "IsClientInGame" reported: Client index 0 is invalid
L 08/31/2015 - 14:09:00: [SM] Displaying call stack trace for plugin "deathrun_manager.smx":
L 08/31/2015 - 14:09:00: [SM]   [0]  Line 7, C:\Users\Dominik\AppData\Roaming\spedit\sourcepawn\configs\sm_one_seven_two\include\deathrun_manager/action_disconnect.sp::DR_Action_Disconnect()
Plugin:
Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <cstrike>
#include <csgocolors>

#undef REQUIRE_PLUGIN
#include <sourcebans>

#define PLUGIN_VERSION "0.1 Beta"

#define CS_TEAM_SPEC 1
#define CS_TEAM_T 2
#define CS_TEAM_CT 3

new Handle:dr_active = INVALID_HANDLE;
new Handle:dr_fixfrags = INVALID_HANDLE;
new Handle:dr_nofragter = INVALID_HANDLE;
new Handle:dr_maxfrags = INVALID_HANDLE;
new Handle:dr_fragct = INVALID_HANDLE;
new Handle:dr_fragt = INVALID_HANDLE;
new Handle:dr_fragtimeout = INVALID_HANDLE;
new Handle:dr_respawn = INVALID_HANDLE;
new Handle:dr_res_snd = INVALID_HANDLE;
new Handle:dr_twin_snd = INVALID_HANDLE;
new Handle:dr_ctwin_snd = INVALID_HANDLE;
new Handle:dr_timeout_snd = INVALID_HANDLE;
new Handle:dr_join_snd = INVALID_HANDLE;
new Handle:dr_fixgravity = INVALID_HANDLE;
new Handle:dr_fixedgravity = INVALID_HANDLE;
new Handle:dr_bonuses = INVALID_HANDLE;
new Handle:dr_downloads = INVALID_HANDLE;
new Handle:dr_scouts = INVALID_HANDLE;
new Handle:dr_scoutster = INVALID_HANDLE;
new Handle:dr_scoutsystem = INVALID_HANDLE;
new Handle:dr_autoban = INVALID_HANDLE;
new Handle:dr_banmessage = INVALID_HANDLE;
new Handle:dr_bantime = INVALID_HANDLE;
new Handle:dr_banmessagetimer = INVALID_HANDLE;
new Handle:dr_antisuicide = INVALID_HANDLE;
new Handle:dr_norestart = INVALID_HANDLE;
new Handle:dr_chooseter = INVALID_HANDLE;
new Handle:dr_numberofters = INVALID_HANDLE;
new Handle:dr_secondter = INVALID_HANDLE;
new Handle:dr_thirdter = INVALID_HANDLE;
new Handle:dr_SpamTime = INVALID_HANDLE;
new Handle:dr_resetscore = INVALID_HANDLE;
new Handle:dr_nighvision = INVALID_HANDLE;
new Handle:Respawn[MAXPLAYERS+1];

new Float:gravity[2048];
new Float:speed[2048];

new String:modelname[2048][255];
new String:model[2048][255];
new const String:DrMaster[] = "Deathrun Master";
new MasterID;
new LeaveTer;
new String:ResSound[128];
new String:JoinSound[128];
new String:TWinSound[128];
new String:CTWinSound[128];
new String:TimeOutSound[128];

new SpawnedScout;
new GameEngine = -1;
new oldterrorist;
new _messagetime;
new _color[2048][4];
new health[2048];
new glow_effect[2048];
new g_bSBAvailable = false;
new GlowColorR[MAXPLAYERS+1] = 0;
new GlowColorG[MAXPLAYERS+1] = 0;
new GlowColorB[MAXPLAYERS+1] = 255;

new bool:dgsteam[MAXPLAYERS+1] = false;
new bool:NextGlowR[MAXPLAYERS+1] = true;
new bool:NextGlowG[MAXPLAYERS+1] = false;
new bool:NextGlowB[MAXPLAYERS+1] = false;
new bool:dr_AntiSpam[MAXPLAYERS+1] = false;
new bool:NoRandom[MAXPLAYERS+1] = false;
new bool:dr_PlayerLoaded[MAXPLAYERS+1] = false;
new bool:ScoutNoGive[MAXPLAYERS+1] = false;
new bool:NoGiveFragT = false;
new bool:NoGiveFragCT = false;
new bool:RespawnTime = false;

#include "deathrun_manager/action_check.sp"
#include "deathrun_manager/action_death.sp"
#include "deathrun_manager/action_disconnect.sp"
#include "deathrun_manager/action_roundend.sp"
#include "deathrun_manager/action_roundstart.sp"
#include "deathrun_manager/action_spawn.sp"
#include "deathrun_manager/action_suicide.sp"
#include "deathrun_manager/action_timers.sp"
#include "deathrun_manager/action_say.sp"

public Plugin:myinfo = {
    name        = "Deathrun Manager!",
    author        = "cyxapuk & Draakoor",
    description = "Deathrun manager CS:S, CS:GO! Fixed",
    version        = PLUGIN_VERSION,
    url = "http://steamcommunity.com/id/cyxapuk; www.thegermanfortress.de" 
};

public OnPluginStart() {
    decl String:GameName[16];
    GetGameFolderName(GameName, sizeof(GameName));
    if(StrEqual(GameName, "cstrike", false))
        GameEngine = 1;
    else if(StrEqual(GameName, "csgo", false))
        GameEngine = 2;
    else {
        SetFailState("This Plugin only works on Counter-Strike: Source or Counter-Strike: Global Offensive.");
        GameEngine = -1;
    }
    CreateConVar("cx_deathrun_version", PLUGIN_VERSION, "0.1 beta", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
    dr_active           = CreateConVar("cx_deathrun_enable", "1", "[CX]DR: Deathrun Manager Enable or Disable Plugins. 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_fixfrags         = CreateConVar("cx_deathrun_fixfrags", "1", "[CX]DR: Fix frags -1 on suicide! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_nofragter         = CreateConVar("cx_deathrun_nofragter", "1", "[CX]DR: No give frags for ters on killed witch weapons! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_maxfrags            = CreateConVar("cx_deathrun_maxfrags", "10", "[CX]DR: Reset player score on kills > Max frags in cyxx/deathrun/deathrun_bonuses.cfg Default: 10, Max: 100, 0 - OFF", FCVAR_PLUGIN, true, 0.0, true, 100.0);
    dr_fragt             = CreateConVar("cx_deathrun_fragterforwin", "1", "[CX]DR: Give frag all terrorist for round win! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_fragct            = CreateConVar("cx_deathrun_fragctforwin", "1", "[CX]DR: Give frag all counter-terrorists for kills all terorrists on trap! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_fragtimeout        = CreateConVar("cx_deathrun_fragfortimeout", "1", "[CX]DR: Give frag all terrorists if time to round end. 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_respawn            = CreateConVar("cx_deathrun_respawn", "0", "[CX]DR: Time to Auto Respawn in seconds. Default: 10, Max: 120, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 120.0);
    dr_fixgravity        = CreateConVar("cx_deathrun_fixgravity", "1", "[CX]DR: Fix bug gravity on ladder! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_bonuses            = CreateConVar("cx_deathrun_bonuses", "1", "[CX]DR: Give player bonuses for frags! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_downloads        = CreateConVar("cx_deathrun_downloads", "1", "[CX]DR: Downloads all files from file 'config/deathrun/deathrun_downloads.cfg'.. 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_scouts            = CreateConVar("cx_deathrun_scouts", "1", "[CX]DR: Give player scouts on use command! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_scoutster        = CreateConVar("cx_deathrun_scoutster", "0", "[CX]DR: Give player scouts in terrorists team?! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_scoutsystem        = CreateConVar("cx_deathrun_scoutsystem", "1", "[CX]DR: System Scout (Max Clients / 2) = Number of scouts. 1 - ON System, 0 - OFF System: 1 Scout to 1 player.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_autoban             = CreateConVar("cx_deathrun_autoban", "1", "[CX]DR: AutoBan Terrorist for exit the game! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_banmessage        = CreateConVar("cx_deathrun_banmessage", "180", "[CX]DR: Time to Ban message in seconds! Max and Default = 180, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 180.0);
    dr_bantime            = CreateConVar("cx_deathrun_bantime", "120", "[CX]DR: Time to AutoBan in minutes! Default: 120, 0 - PERMANENT.", FCVAR_PLUGIN, true, 0.0, true, 99999.0);
    dr_antisuicide         = CreateConVar("cx_deathrun_antisuicide", "1", "[CX]DR: Not use suicide command and not give fall damage only for terrorists! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_norestart        = CreateConVar("cx_deathrun_fixrestart", "1", "[CX]DR: Anti restart round on terrorist disconnected! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_chooseter        = CreateConVar("cx_deathrun_chooseter", "1", "[CX]DR: Auto Random Choose Terrorists! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_numberofters        = CreateConVar("cx_deathrun_numberofters", "3", "[CX]DR: Number of Terrorist for random choose. Max: 3!", FCVAR_PLUGIN, true, 0.0, true, 3.0);
    dr_secondter        = CreateConVar("cx_deathrun_secondter", "12", "[CX]DR: Choose 2 terrorist if player on server more 'Default' '12'! Max: 64, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 64.0);
    dr_thirdter            = CreateConVar("cx_deathrun_thirdter", "23", "[CX]DR: Choose 3 terrorist (not work if secondter = 0) if player on server more 'Default' '23'! Max: 64, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 64.0);
    dr_SpamTime            = CreateConVar("cx_deathrun_antispam", "7", "[CX]DR: Anti-Spam Message, time in seconds. Max 60.", FCVAR_PLUGIN, true, 0.0, true, 60.0);
    if (GameEngine == 1) {
        dr_res_snd            = CreateConVar("cx_deathrun_res_snd", "cyxx/deathrun/res.mp3", "[CX]DR: Path 'sound/..' to play sound on auto respawn player.");
        dr_twin_snd            = CreateConVar("cx_deathrun_twin_snd", "cyxx/deathrun/twin.mp3", "[CX]DR: Path 'sound/..' to play sound on auto respawn player.");
        dr_ctwin_snd        = CreateConVar("cx_deathrun_ctwin_snd", "cyxx/deathrun/ctwin.mp3", "[CX]DR: Path 'sound/..' to play sound on auto respawn player.");
        dr_timeout_snd        = CreateConVar("cx_deathrun_timeout_snd", "cyxx/deathrun/timeout.mp3", "[CX]DR: Path 'sound/..' to play sound on auto respawn player.");
        dr_join_snd            = CreateConVar("cx_deathrun_join_snd", "cyxx/deathrun/csgo_dr_join.mp3", "[CX]DR: Path 'sound/..' to play sound on auto respawn player.");
    }
    if (GameEngine == 2) {
        dr_res_snd            = CreateConVar("cx_deathrun_res_snd", "*cyxx/deathrun/res.mp3", "[CX]DR: if CS:GO use in Pre Path'*' 'sound/..' to play sound on auto respawn player.");
        dr_twin_snd            = CreateConVar("cx_deathrun_twin_snd", "*cyxx/deathrun/twin.mp3", "[CX]DR: if CS:GO use in Pre Path '*' Path 'sound/..' to play sound if roune end reason terrorist win.");
        dr_ctwin_snd        = CreateConVar("cx_deathrun_ctwin_snd", "*cyxx/deathrun/ctwin.mp3", "[CX]DR: if CS:GO use in Pre Path '*' Path 'sound/..' to play sound if roune end reason counter-terrorist win.");
        dr_timeout_snd        = CreateConVar("cx_deathrun_timeout_snd", "*cyxx/deathrun/timeout.mp3", "[CX]DR: if CS:GO use in Pre Path '*' Path 'sound/..' to play sound if roune end reason timeout");
        dr_join_snd            = CreateConVar("cx_deathrun_join_snd", "*cyxx/deathrun/csgo_dr_join.mp3", "[CX]DR: if CS:GO use in Pre Path '*' Path 'sound/..' to play sound on client join server.");
    }
    dr_resetscore        = CreateConVar("cx_deathrun_resetcore", "1", "[CX]DR: Reset Deaths! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);
    dr_nighvision        = CreateConVar("cx_deathrun_nightvision", "1", "[CX]DR: Give Player Night Vision! 1 - ON, 0 - OFF.", FCVAR_PLUGIN, true, 0.0, true, 1.0);

    _messagetime = GetConVarInt(dr_banmessage);
    HookConVarChange(dr_banmessage, ConVarChanged);
    
    HookEventEx("player_death", DR_Action_Death, EventHookMode_Pre);
    HookEventEx("round_end", DR_Action_RoundEnd, EventHookMode);
    HookEventEx("round_start", DR_Action_RoundStart, EventHookMode);
    HookEvent("player_spawn", DR_Action_Spawn, EventHookMode);
    HookEvent("player_disconnect", DR_Action_Disconnect, EventHookMode_Pre);
    HookEvent("player_team", DR_BlockTeamMessage, EventHookMode_Pre);

    RegConsoleCmd("jointeam", DR_Player_JoinTeam);
    RegConsoleCmd("spectate", DR_Player_Spectate);
    RegConsoleCmd("kill", DR_BlockSuicide);
    RegConsoleCmd("joinclass", DR_BlockSuicide);
    RegConsoleCmd("explode", DR_BlockSuicide);
    RegConsoleCmd("say", DR_Say_Commands);
    RegConsoleCmd("say_team", DR_Say_Commands);
    
    RegAdminCmd("sm_setfrags", DeathrunSetFrags, ADMFLAG_ROOT, "Command Set Frags");
    
    LoadTranslations("cx.deathrun-manager.phrases.txt");
    AutoExecConfig(true, "cx.deathrun-manager");
}

public Action:resetscore(client) {
    if (!GetConVarBool(dr_active) || !IsClientInGame(client))
        return Plugin_Continue;
    if (!GetConVarBool(dr_resetscore))
        return Plugin_Continue;
        
    SetEntProp( client, Prop_Data, "m_iDeaths", 0 );
    if (GameEngine == 1)
        CPrintToChat(client, "{GREEN}%t {DARKRED}%t", "LANG_DR_INFO", "LANG_SCORE_RESET");
    if (GameEngine == 2)
        CPrintToChat(client, "{GREEN}%t {DARKRED}%t", "LANG_DR_INFO", "LANG_SCORE_RESET");
    return Plugin_Continue;
}

public Action:DeathrunSetFrags(client, args)
{
    new String:arg1[32], String:arg2[32];
    new countfrag;
    GetCmdArg(1, arg1, sizeof(arg1));
    if (args < 2) {
        ReplyToCommand(client, "%t %t", "LANG_DR_INFO", "LANG_DR_SETFRAG");
        return Plugin_Handled;
    }
    if (args >= 2 && GetCmdArg(2, arg2, sizeof(arg2))) {
        countfrag = StringToInt(arg2);
        GetCmdArg(1, arg1, sizeof(arg2));
    }
    
    if (countfrag == 0) {
        ReplyToCommand(client, "%t %t", "LANG_DR_INFO", "LANG_DR_FRAG0");
        return Plugin_Handled;
    }

    new String:target_name[MAX_TARGET_LENGTH];
    new target_list[MAXPLAYERS], target_count;
    new bool:tn_is_ml;
 
    if ((target_count = ProcessTargetString(
            arg1,
            client,
            target_list,
            MAXPLAYERS,
            COMMAND_FILTER_NO_BOTS|COMMAND_FILTER_CONNECTED,
            target_name,
            sizeof(target_name),
            tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Handled;
    }

    for (new i = 0; i < target_count; i++) {
        if (!IsClientInGame(target_list[i]))
            return Plugin_Handled;
        SetEntProp(target_list[i], Prop_Data, "m_iFrags", GetClientFrags(target_list[i]) + countfrag);
        LogAction(client, target_list[i], "\"%L\" Added to player \"%L\": %d frags:", client, target_list[i], countfrag);
    }
    decl String:PlayerS[64];
    GetClientName(client, PlayerS, sizeof(PlayerS));

    if (tn_is_ml) {
        if (countfrag >= 0) {
            CPrintToChatAll("%t %s %t %s, %d %t!", "LANG_DR_INFO", PlayerS, "LANG_DR_ADDFRAG", target_name, countfrag, "LANG_DR_FRAGS");
        } else {
            countfrag -= countfrag*2;
            CPrintToChatAll("%t %s %t %s, %d %t!", "LANG_DR_INFO", PlayerS, "LANG_DR_REMOVEFRAG", target_name, countfrag, "LANG_DR_FRAGS");
        }
    } else {
        if (countfrag >= 0) {
            CPrintToChatAll("%t %s %t %s, %d %t!", "LANG_DR_INFO", PlayerS, "LANG_DR_ADDFRAG", target_name, countfrag, "LANG_DR_FRAGS");
        } else {
            countfrag -= countfrag*2;
            CPrintToChatAll("%t %s %t %s, %d %t!", "LANG_DR_INFO", PlayerS, "LANG_DR_REMOVEFRAG", target_name, countfrag, "LANG_DR_FRAGS");
        }
    }

    return Plugin_Handled;
}

public OnAllPluginsLoaded()
    if (LibraryExists("sourcebans"))
        g_bSBAvailable = true;

public OnLibraryAdded(const String:name[])
    if (StrEqual(name, "sourcebans"))
        g_bSBAvailable = true;

public OnLibraryRemoved(const String:name[])
    if (StrEqual(name, "sourcebans"))
        g_bSBAvailable = false;

public OnClientPutInServer(client)
{
    if (GetConVarBool(dr_active)) {
        dr_PlayerLoaded[client] = true;
        EmitSoundToClient(client, JoinSound);
        if (GameEngine == 2) {
            ChangeClientTeam(client, CS_TEAM_SPEC);
        }
        if (GetConVarBool(dr_bonuses)) {
            GlowColorR[client] = 0;
            GlowColorG[client] = 0;
            GlowColorB[client] = 255;
            NextGlowR[client] = true;
            NextGlowG[client] = false;
            NextGlowB[client] = false;
        }
    }
}

public OnMapStart() {
    if (GetConVarBool(dr_active)) {
        
        if (GetConVarBool(dr_fixgravity) && GameEngine == 1) {
            dr_fixedgravity = CreateTimer(1.0, FixGravity);
        }
        
        new String:file[256];
        BuildPath(Path_SM, file, 255, "configs/cyxx/deathrun/deathrun_downloads.cfg");
        new Handle:fileh = OpenFile(file, "r");
        new String:buffer[256];
    
        if (GetConVarBool(dr_downloads)) {
            if (fileh == INVALID_HANDLE)  return;
            while (ReadFileLine(fileh, buffer, sizeof(buffer)))
            {
                new len = strlen(buffer);
                if (buffer[len-1] == '\n')
                    buffer[--len] = '\0';
               
                TrimString(buffer);
                if(len >= 2 && buffer[0] == '/' && buffer[1] == '/'){
                } 
                else if (!StrEqual(buffer,"",false) && FileExists(buffer))
                {
                    AddFileToDownloadsTable(buffer);
                }
                if (IsEndOfFile(fileh))
                break;
            }
        }
        if (_messagetime > 0) {
            dr_banmessagetimer = CreateTimer(GetConVarFloat(dr_banmessage), banmsg);
        }
        
        if (GetConVarBool(dr_norestart) && GetConVarBool(dr_autoban)) {
            CreateTimer(5.0, CreateMaster);
        }
    }
}

public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    _messagetime = GetConVarInt(dr_banmessage);
    
}

public OnConfigsExecuted()
{
    GetConVarString(dr_res_snd, ResSound, sizeof(ResSound));
    GetConVarString(dr_twin_snd, TWinSound, sizeof(TWinSound));
    GetConVarString(dr_ctwin_snd, CTWinSound, sizeof(CTWinSound));
    GetConVarString(dr_timeout_snd, TimeOutSound, sizeof(TimeOutSound));
    GetConVarString(dr_join_snd, JoinSound, sizeof(JoinSound));
    PrecacheSound(ResSound, true);
    PrecacheSound(TWinSound, true);
    PrecacheSound(CTWinSound, true);
    PrecacheSound(TimeOutSound, true);
    PrecacheSound(JoinSound, true);
}

public OnMapEnd()
{
    
    if (dr_fixedgravity) {
        KillTimer(dr_fixedgravity);
        dr_fixedgravity = INVALID_HANDLE;
    }
    
    if (dr_banmessagetimer) {
        KillTimer(dr_banmessagetimer);
        dr_banmessagetimer = INVALID_HANDLE;
    }

    if (GetConVarBool(dr_active) && GetConVarBool(dr_chooseter))
    {
        for (new i = 1; i <= MaxClients; i++) {
            NoRandom[i] = false;
        }
    }
}

public Action:DR_BlockTeamMessage(Handle:event, String:name[], bool:dontBroadcast)
{
    if (!dontBroadcast)
    {
        new Handle:hEvent = CreateEvent("player_team", false);
        new String:clientName[36];
        new userId = GetEventInt(event, "userid");
        new client = GetClientOfUserId(userId);
        if (hEvent)
        {
            GetClientName(client, clientName, 33);
            SetEventInt(hEvent, "userid", userId);
            SetEventInt(hEvent, "team", GetEventInt(event, "team"));
            SetEventInt(hEvent, "team_old", GetEventInt(event, "team_old"));
            SetEventBool(hEvent, "disconnect", GetEventBool(event, "disconnect"));
            SetEventBool(hEvent, "autoteam", GetEventBool(event, "autoteam"));
            SetEventBool(hEvent, "silent", GetEventBool(event, "silent"));
            SetEventString(hEvent, "name", clientName);
            FireEvent(hEvent, true);
        }
    }
    return Plugin_Handled;
}
Action Roundstart:
Code:
public Action:DR_Action_RoundStart(Handle:event, String:name[], bool:dontBroadcast)
{
    if (GetConVarBool(dr_active)) {
        if (GetConVarBool(dr_scouts))
            ResetScouts();

        if (GetConVarBool(dr_respawn) && GetConVarInt(dr_respawn) > 0) {
            CreateTimer(GetConVarFloat(dr_respawn), EndRespawnTimer);
            RespawnTime = true;
        }
        for (new i = 1; i <= MaxClients; i++) {
            if (IsClientInGame(i) && i > 0 && GetClientTeam(i) == CS_TEAM_SPEC) {
                if (GameEngine == 1) {
                    CPrintToChat(i, "{lightgreen}%t {green}Deathrun Manager by cyxapuk & Draakoor", "LANG_DR_INFO");
                    CPrintToChat(i, "{lightgreen}%t {green}Steamgroup: http://steamcommunity.com/groups/thegermanfortresscommunity", "LANG_DR_INFO");
                }
                if (GameEngine == 2) {
                    CPrintToChat(i, "{NORMAL} {lightgreen}%t \x07Deathrun Manager by cyxapuk & Draakoor", "LANG_DR_INFO");
                    CPrintToChat(i, "{NORMAL} {lightgreen}%t \x07Steamgroup: http://steamcommunity.com/groups/thegermanfortresscommunity", "LANG_DR_INFO");
                }
            }
            if (IsFakeClient(i))
            {
                ChangeClientTeam(i, 1);
            }
        }
    }
}
__________________
NickischLP is offline
Send a message via Skype™ to NickischLP
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-31-2015 , 14:29   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #2

I'm sure if you read the errors you get your answers
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
NickischLP
Senior Member
Join Date: Jun 2013
Location: Germany
Old 08-31-2015 , 14:31   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #3

Nope, i dont find the error in the code.

I am a newbie at sourcepawn
__________________
NickischLP is offline
Send a message via Skype™ to NickischLP
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 08-31-2015 , 14:51   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #4

at the line that has been told to you, there is a loop where you start the index at 0 which is the server and which is not a valid entity so it create an error because IsClientInGame need a valid entity. Either use IsValidEntity before IsClientInGame or simple start your loop var at 1.
Mathias. is offline
NickischLP
Senior Member
Join Date: Jun 2013
Location: Germany
Old 08-31-2015 , 16:16   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #5

Now I get this error:
[SM] Native "IsFakeClient" reported: Client 7 is not connected
L 08/31/2015 - 16:016: [SM] Displaying call stack trace for plugin "deathrun_manager.smx":
L 08/31/2015 - 16:016: [SM] [0] Line 22, C:\Users\Dominik\AppData\Roaming\spedit\sourc epawn\configs\sm_one_seven_two\include\deathr un_manager/action_roundstart.sp:R_Action_RoundStart()

I dont know whats my fault. The Round doesnt start.

You can check it yourself if you want: IP: csgo.tgf-servers.de:27083

Please help.
__________________

Last edited by NickischLP; 08-31-2015 at 16:17.
NickischLP is offline
Send a message via Skype™ to NickischLP
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 08-31-2015 , 16:24   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #6

Do a IsClientInGame(client) check before checking IsFakeClient(client) check.
__________________
Chaosxk is offline
NickischLP
Senior Member
Join Date: Jun 2013
Location: Germany
Old 08-31-2015 , 16:26   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #7

if (IsClientInGame(i) && i > 1 && GetClientTeam(i) == CS_TEAM_SPEC)

I changed this.

I am a noob ;(

I dont understand what you mean
__________________
NickischLP is offline
Send a message via Skype™ to NickischLP
Chaosxk
Veteran Member
Join Date: Aug 2010
Location: Westeros
Old 08-31-2015 , 17:36   Re: [NEEDHELP]Error deathrun manager
Reply With Quote #8

You just need to move the code around, IsFakeClient is moved inside the statement of IsClientInGame, also you shouldn't need i > 1 since the for loop starts at 1 so the statement is just redundant.

Just change your for loop part of the code to this.
PHP Code:
for (new 1<= MaxClientsi++) {
    if (
IsClientInGame(i)) {
        if (
GetClientTeam(i) == CS_TEAM_SPEC) {
            if (
GameEngine == 1) {
                
CPrintToChat(i"{lightgreen}%t {green}Deathrun Manager by cyxapuk & Draakoor""LANG_DR_INFO");
                
CPrintToChat(i"{lightgreen}%t {green}Steamgroup: http://steamcommunity.com/groups/thegermanfortresscommunity""LANG_DR_INFO");
            }
            if (
GameEngine == 2) {
                
CPrintToChat(i"{NORMAL} {lightgreen}%t \x07Deathrun Manager by cyxapuk & Draakoor""LANG_DR_INFO");
                
CPrintToChat(i"{NORMAL} {lightgreen}%t \x07Steamgroup: http://steamcommunity.com/groups/thegermanfortresscommunity""LANG_DR_INFO");
            }
        }
        if (
IsFakeClient(i))
        {
            
ChangeClientTeam(i1);
        }
    }

__________________
Chaosxk 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 03:18.


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