My Server crashes no reason
#1

Hi, i'm having a problem.. when i'm on my dedicated server and player kills someone the server doesn't crash. but on the hosted server it does. Its so weird i tried using Crashdetect and .so extensions and noting worked! I dont know where to start to fix it because it actually isn't a bug on my dedicated server but on the hosted. do you guys might know why this is happening? I'll give OnPlayerDeath code which might explain anything..

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        if(Drag[playerid])
        {
            new playerb;
            Drag[playerid] = -1;
            Dragged[playerb] = -1;
        }
        /*if(GetPVarInt(playerid,"roped") == 1)
        {
            for(new destr2=0;destr2<=ropelength;destr2++)
            {
                DestroyObject(r0pes[playerid][destr2]);
            }
            SetPVarInt(playerid,"roped",0);
            DisablePlayerCheckpoint(playerid);
            ClearAnimations(playerid);
        }*/

        Dragged[playerid] = -1;
        Inenforcer[playerid] = 0;
        KillTimer(timer4);
        KillTimer(timer5);
        if(USE_ANTI_FAKE_KILL == true)
        {
            if(GetPlayerWeapon(killerid) == reason && !PlayerInfo[playerid][pAdmin])
            {
                SendClientMessage(playerid, COLOR_RED, "{539600}[ANTI-CHEAT]{74D400} You have been kicked by zMax Anti-Cheat for possible fake-killing.");
                Kick(playerid);
            }
            if(killerid == playerid && !PlayerInfo[playerid][pAdmin])
            {
                SendClientMessage(playerid, COLOR_RED, "{539600}[ANTI-CHEAT]{74D400} You have been kicked by zMax Anti-Cheat for possible fake-killing.");
                Kick(playerid);
            }
        }
        if(LicenseTest[playerid])
        {
            DisablePlayerCheckpoint(playerid);
            LicenseTest[playerid] = 0;
            DrivingStep[playerid] = 0;
            SetVehicleToRespawn(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You died in-test, therefore your test has been canceled.");
        }
        if(FedexJob[playerid])
        {
            DisablePlayerCheckpoint(playerid);
            FedexJob[playerid] = 0;
            FedexStep[playerid] = 0;
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You died in-work, therefore your job canceled.");
        }
        if(IsPlayerLoggedIn(playerid))
        {
            if(DayNoDrops == 1)
            {
                for(new i=0; i<13; i++)
                {
                    GetPlayerWeaponData(playerid, i, DNDW[i][0], DNDW[i][1]);
                }
                GunsBeingRemoved[playerid] = 1;
                ResetPlayerWeapons(playerid);
            }
            if(Planted[playerid] == 1)
            {
                DestroyObject(C4[playerid]);
                Bomb[playerid] = 0;
                Planted[playerid] = 0;
            }
            Pspawned[playerid] = 0;
            if(BankRobber[playerid])
            {
                new string[128];
                new Rob = BankRobber[playerid]-1;
                DisablePlayerCheckpoint(playerid);
                BankRobbersCount --;
                format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
                DeliverMoney[playerid] = 0;
                //
                foreach(Player, i)
                {
                    if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
                    {
                        if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
                        else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
                        else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
                        else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
                        else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
                    }
                }
                format(string, sizeof(string), "** %s has been hospitalized and has failed the robbery. **", RPN(playerid));
                SendRobberyMessage(COLOR_LIGHTRED, string);
                SendCopMessage(COLOR_LIGHTRED, string);
                BankRobber[playerid] = 0;
                PlayerInfo[playerid][pBlindfold] = 0;
                if(BankRobbersCount == 0)
                {
                    TextDrawHideForAll(Textdraw0);
                    TextDrawHideForAll(Textdraw1);
                    TextDrawHideForAll(Textdraw2);
                    TextDrawHideForAll(Textdraw3);
                    TextDrawHideForAll(Textdraw4);
                    TextDrawHideForAll(Textdraw5);
                    BankRobbery = 0;
                    RobberyStarted = 0;
                    format(string, sizeof(string), "** The bank robbery has ended, $%d were stolen and $%d were saved. **", TotalStolen*10000, (TotalRobbers*10000-(TotalStolen*10000)));
                    SendClientMessageToAll(COLOR_YELLOW, string);
                    TotalRobbers = 0;
                    new copsonline;
                    foreach(Player, i)
                    {
                        if(IsACop(i)) copsonline++;
                    }
                    foreach(Player, i)
                    {
                        if(IsACop(i))
                        {
                            new Saved = (TotalRobbers*10000-(TotalStolen*10000));
                            GiveDodMoney(i, Saved/copsonline);
                            format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
                            SendClientMessage(i, COLOR_LIME, string);
                        }
                    }
                }
            }
            DeletePVar(playerid, "SpeedRadar");
            if(WearingMask[playerid] == 1)
            {
                WearingMask[playerid] = 0;
                for(new i; i<MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                    {
                        ShowPlayerNameTagForPlayer(i, playerid, 1);
                    }
                }
            }
            if(Event[playerid])
            {
                new string[128];
                format(string, sizeof(string), "OnEventDeath: %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
                Log("Logs/deaths.log", string);
                foreach(Player, i)
                {
                    if(Event[i]) SendClientMessage(i, COLOR_REPORT, string);
                }
                Event[playerid] = 0;
                eventdeath[playerid] = 1;
            }
            if(Duel[playerid])
            {
                Duel[playerid] = 0;
                Duel[killerid] = 0;
                DuelOn = 0;
                dueldeath[playerid] = 1;
                dueldeath[killerid] = 0;
                SetPlayerPos(killerid, eX, eY, eZ);
                SetPlayerInterior(killerid, PlayerInfo[killerid][pInt]);
                SetPlayerVirtualWorld(killerid, PlayerInfo[killerid][pVW]);
                PlayerInfo[killerid][pHospital] = 0;
                SetPlayerHealth(killerid, eHP);
                SetPlayerArmour(killerid, eARMOR);
                SendClientMessage(killerid, COLOR_LIGHTRED, "*** You won the duel, nice job. ***");
                GunsBeingRemoved[killerid] = 1;
                ResetPlayerWeapons(killerid);
                GunsBeingRemoved[killerid] = 1;
                for(new w = 0; w < 13; w++)
                {
                    GiveDodWeapon(killerid, PlayerInfo[killerid][pWeapon][w], PlayerInfo[killerid][pWeaponAmmo][w]);
                }
            }
            if(PlayerPaintballing[playerid] == 1)
            {
                new string[128];
                for (new i = 0; i < 13; i++)
                {
                    GetPlayerWeaponData(playerid, i, pbGuns[i][0], pbGuns[i][1]);
                }
                format(string, sizeof(string), "PaintballDeathLog: %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
                Log("Logs/deaths.log", string);
                new Float:myhp;
                GetPlayerHealth(killerid, myhp);
                SetPlayerHealth(killerid, myhp+30);
                if(myhp == 100)
                {
                    SetPlayerHealth(killerid, 100);
                }
                foreach(Player, i)
                {
                    if(PlayerPaintballing[i]) SendClientMessage(i, COLOR_REPORT, string);
                }
                PlayerPaintballing[playerid] = 1;
            }
            else
            {
                PlayerInfo[playerid][pHospital] = 1;
                PlayerInfo[playerid][pArmor] = 0;
                if(IsPlayerLoggedIn(killerid))
                {
                    new string[128];
                    format(string, sizeof(string), "DeathLog %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
                    SendAdminMessage(COLOR_DARKRED, 1, string);
                    Log("Logs/deaths.log", string);
                    PlayerInfo[playerid][pDeath] ++;
                    PlayerInfo[killerid][pKill] ++;
                    if(Hitman[killerid] == playerid)
                    {
                        format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d, the contrat on your head was cleared.", PlayerInfo[playerid][pContract]/2);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                        format(string, sizeof(string), "HitmanWarn: %s has fulfilled the contract on %s's head and collected $%d.", RPN(killerid), RPN(playerid), PlayerInfo[playerid][pContract]/2);
                        SendHitmanMessage(COLOR_YELLOW, string);
                        GiveDodMoney(playerid, -PlayerInfo[playerid][pContract]/2);
                        GiveDodMoney(killerid, PlayerInfo[playerid][pContract]/2);
                        PlayerInfo[playerid][pContract] = 0;
                        format(PlayerInfo[playerid][pContract], 32, "");
                        Hitman[killerid] = -1;
                        PlayerInfo[killerid][pCSuccess] ++;
                    }
                    if(Hitman[playerid] == killerid)
                    {
                        format(string, sizeof(string), " You have critically injured a hitman and collected $%d, the contrat on your head was cleared.", PlayerInfo[killerid][pContract]);
                        SendClientMessage(killerid, COLOR_YELLOW, string);
                        format(string, sizeof(string), "HitmanWarn: %s has failed the contract on %s's head and lost $%d.", RPN(playerid), RPN(killerid), PlayerInfo[killerid][pContract]);
                        SendHitmanMessage(COLOR_YELLOW, string);
                        GiveDodMoney(playerid, -PlayerInfo[killerid][pContract]);
                        GiveDodMoney(killerid, PlayerInfo[killerid][pContract]);
                        PlayerInfo[killerid][pContract] = 0;
                        format(PlayerInfo[killerid][pContract], 32, "");
                        Hitman[playerid] = -1;
                        PlayerInfo[playerid][pCFail] ++;
                    }
                }
            }
        }
    }
    return 1;
}
Reply
#2

What does Crashdetect print on your Server Log?
Reply
#3

Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
What does Crashdetect print on your Server Log?
Noting. Its like the server crashing with absolutely no reason..

Does anyone knows why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)